mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-15 15:50:22 -04:00
Merge pull request #912 from linuxserver/mod-scripts-lsiown
Move lsiown into its own package
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Version 1
|
||||||
|
# 2024-06-08 - Initial Version
|
||||||
|
|
||||||
|
LSIOWN_SCRIPT_VER="1.20240608"
|
||||||
|
|
||||||
|
MAXDEPTH=("-maxdepth" "0")
|
||||||
|
OPTIONS=()
|
||||||
|
while getopts RcfvhHLP OPTION
|
||||||
|
do
|
||||||
|
if [[ "${OPTION}" != "?" && "${OPTION}" != "R" ]]; then
|
||||||
|
OPTIONS+=("-${OPTION}")
|
||||||
|
fi
|
||||||
|
if [[ "${OPTION}" = "R" ]]; then
|
||||||
|
MAXDEPTH=()
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
shift $((OPTIND - 1))
|
||||||
|
OWNER=$1
|
||||||
|
IFS=: read -r USER GROUP <<< "${OWNER}"
|
||||||
|
if [[ -z "${GROUP}" ]]; then
|
||||||
|
printf '**** Permissions could not be set. Group is missing or incorrect, expecting user:group. ****\n'
|
||||||
|
exit 0
|
||||||
|
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}")
|
||||||
|
/usr/bin/find "${PATH[@]}" "${MAXDEPTH[@]}" ! -xtype l \( ! -group "${GROUP}" -o ! -user "${USER}" \) -exec chown "${OPTIONS[@]}" "${USER}":"${GROUP}" {} + || printf "${ERROR}"
|
||||||
+10
-7
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
# Version 1
|
# Version 1
|
||||||
# 2024-03-26 - Initial Version
|
# 2024-03-26 - Initial Version
|
||||||
PKG_SCRIPT_VER="3.20240326"
|
PKG_SCRIPT_VER="1.20240608"
|
||||||
|
|
||||||
write_mod_info() {
|
write_mod_info() {
|
||||||
local MSG=$*
|
local MSG=$*
|
||||||
@@ -46,7 +46,7 @@ if [[ -f "/mod-repo-packages-to-install.list" ]]; then
|
|||||||
IFS=' ' read -ra REPO_PACKAGES <<< "$(tr '\n' ' ' < /mod-repo-packages-to-install.list)"
|
IFS=' ' read -ra REPO_PACKAGES <<< "$(tr '\n' ' ' < /mod-repo-packages-to-install.list)"
|
||||||
if [[ ${#REPO_PACKAGES[@]} -ne 0 ]] && [[ ${REPO_PACKAGES[*]} != "" ]]; then
|
if [[ ${#REPO_PACKAGES[@]} -ne 0 ]] && [[ ${REPO_PACKAGES[*]} != "" ]]; then
|
||||||
write_mod_info "Installing all mod packages"
|
write_mod_info "Installing all mod packages"
|
||||||
write_mod_debug "Defined packages: ${REPO_PACKAGES[@]}"
|
write_mod_debug "Defined packages: ${REPO_PACKAGES[*]}"
|
||||||
if [[ -f /usr/bin/apt ]]; then
|
if [[ -f /usr/bin/apt ]]; then
|
||||||
export DEBIAN_FRONTEND="noninteractive"
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
apt-get update
|
apt-get update
|
||||||
@@ -86,8 +86,8 @@ if [[ -f "/mod-pip-packages-to-install.list" ]]; then
|
|||||||
ALPINE_VER=$(grep main /etc/apk/repositories | sed 's|.*alpine/v||' | sed 's|/main.*||')
|
ALPINE_VER=$(grep main /etc/apk/repositories | sed 's|.*alpine/v||' | sed 's|/main.*||')
|
||||||
PIP_ARGS+=("-f" "https://wheel-index.linuxserver.io/alpine-${ALPINE_VER}/")
|
PIP_ARGS+=("-f" "https://wheel-index.linuxserver.io/alpine-${ALPINE_VER}/")
|
||||||
fi
|
fi
|
||||||
write_mod_debug "Installing defined pip packages: ${PIP_PACKAGES[@]}"
|
write_mod_debug "Installing defined pip packages: ${PIP_PACKAGES[*]}"
|
||||||
write_mod_debug "Using pip args ${PIP_ARGS[@]}"
|
write_mod_debug "Using pip args ${PIP_ARGS[*]}"
|
||||||
python3 -m pip install \
|
python3 -m pip install \
|
||||||
"${PIP_ARGS[@]}" \
|
"${PIP_ARGS[@]}" \
|
||||||
"${PIP_PACKAGES[@]}"
|
"${PIP_PACKAGES[@]}"
|
||||||
@@ -95,6 +95,9 @@ if [[ -f "/mod-pip-packages-to-install.list" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
write_mod_debug "Deleting temporary install lists for os and pip packages."
|
write_mod_debug "Deleting temporary install lists for os and pip packages."
|
||||||
rm -rf \
|
if [[ -f "/mod-repo-packages-to-install.list" ]]; then
|
||||||
/mod-repo-packages-to-install.list \
|
rm -rf /mod-repo-packages-to-install.list
|
||||||
/mod-pip-packages-to-install.list
|
fi
|
||||||
|
if [[ -f "/mod-pip-packages-to-install.list" ]]; then
|
||||||
|
rm -rf /mod-pip-packages-to-install.list
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user