mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-18 00:45:46 -04:00
Merge pull request #763 from linuxserver/fix-lsiown
Fix lsiown edge cases
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
These files are used by Linuxserver build processes to handle mods in our images. Not for end-user consumption.
|
These files are used by Linuxserver build processes to handle mods in our images. Not for end-user consumption.
|
||||||
|
|
||||||
|
* **14.09.23:** - Fix lsiown edge cases.
|
||||||
* **08.09.23:** - Change lsiown to skip files that are already owned by the user.
|
* **08.09.23:** - Change lsiown to skip files that are already owned by the user.
|
||||||
* **25.05.23:** - Add lscr.io support for mods.
|
* **25.05.23:** - Add lscr.io support for mods.
|
||||||
* **16.05.23:** - Add package installer.
|
* **16.05.23:** - Add package installer.
|
||||||
|
|||||||
+7
-2
@@ -111,12 +111,16 @@ create_lsiown_alias() {
|
|||||||
cat <<-'EOF' >/usr/bin/lsiown
|
cat <<-'EOF' >/usr/bin/lsiown
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
MAXDEPTH=("-maxdepth" "0")
|
||||||
OPTIONS=()
|
OPTIONS=()
|
||||||
while getopts RcfvhHLP OPTION
|
while getopts RcfvhHLP OPTION
|
||||||
do
|
do
|
||||||
if [[ "${OPTION}" != "?" ]]; then
|
if [[ "${OPTION}" != "?" && "${OPTION}" != "R" ]]; then
|
||||||
OPTIONS+=("-${OPTION}")
|
OPTIONS+=("-${OPTION}")
|
||||||
fi
|
fi
|
||||||
|
if [[ "${OPTION}" = "R" ]]; then
|
||||||
|
MAXDEPTH=()
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
shift $((OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
@@ -127,8 +131,9 @@ create_lsiown_alias() {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ERROR='**** Permissions could not be set. This is probably because your volume mounts are remote or read-only. ****\n**** The app may not work properly and we will not provide support for it. ****\n'
|
||||||
PATH=("${@:2}")
|
PATH=("${@:2}")
|
||||||
/usr/bin/find "${PATH[@]}" \( ! -group "${GROUP}" -o ! -user "${USER}" \) -exec chown "${OPTIONS[@]}" "${USER}":"${GROUP}" {} + || printf '**** Permissions could not be set. This is probably because your volume mounts are remote or read-only. ****\n**** The app may not work properly and we will not provide support for it. ****\n'
|
/usr/bin/find "${PATH[@]}" "${MAXDEPTH[@]}" \( ! -group "${GROUP}" -o ! -user "${USER}" \) -exec chown "${OPTIONS[@]}" "${USER}":"${GROUP}" {} + || printf "${ERROR}"
|
||||||
EOF
|
EOF
|
||||||
chmod +x /usr/bin/lsiown
|
chmod +x /usr/bin/lsiown
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user