mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-18 16:58:27 -04:00
CR fixes
This commit is contained in:
+6
-8
@@ -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))
|
||||||
@@ -129,13 +133,7 @@ create_lsiown_alias() {
|
|||||||
|
|
||||||
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'
|
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[@]}" "${MAXDEPTH[@]}" \( ! -group "${GROUP}" -o ! -user "${USER}" \) -exec chown "${OPTIONS[@]}" "${USER}":"${GROUP}" {} + || printf "${ERROR}"
|
||||||
if [[ "${OPTIONS[*]}" =~ "-R" ]]; then
|
|
||||||
OPTIONS=( "${OPTIONS[@]/-R/-P}" )
|
|
||||||
/usr/bin/find "${PATH[@]}" \( ! -group "${GROUP}" -o ! -user "${USER}" \) -exec chown "${OPTIONS[@]}" "${USER}":"${GROUP}" {} + || printf "${ERROR}"
|
|
||||||
else
|
|
||||||
/usr/bin/find "${PATH[@]}" -maxdepth 0 \( ! -group "${GROUP}" -o ! -user "${USER}" \) -exec chown "${OPTIONS[@]}" "${USER}":"${GROUP}" {} + || printf "${ERROR}"
|
|
||||||
fi
|
|
||||||
EOF
|
EOF
|
||||||
chmod +x /usr/bin/lsiown
|
chmod +x /usr/bin/lsiown
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user