Merge pull request #165 from linuxserver/3.17-legacy-scripts
Remove legacy scripts check
This commit is contained in:
commit
91a498c9e2
|
|
@ -18,8 +18,6 @@ RUN \
|
|||
apk add --no-cache \
|
||||
bash \
|
||||
curl \
|
||||
patch \
|
||||
tar \
|
||||
tzdata \
|
||||
xz
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ RUN \
|
|||
apk add --no-cache \
|
||||
bash \
|
||||
curl \
|
||||
patch \
|
||||
tar \
|
||||
tzdata \
|
||||
xz
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ RUN \
|
|||
apk add --no-cache \
|
||||
bash \
|
||||
curl \
|
||||
patch \
|
||||
tar \
|
||||
tzdata \
|
||||
xz
|
||||
|
||||
|
|
|
|||
|
|
@ -2,21 +2,8 @@
|
|||
# shellcheck shell=bash
|
||||
|
||||
# Directories
|
||||
SCRIPTS_DIR_OLD="/config/custom-cont-init.d"
|
||||
SCRIPTS_DIR="/custom-cont-init.d"
|
||||
|
||||
SERVICES_DIR_OLD="/config/custom-services.d"
|
||||
|
||||
# chown legacy folders if they exist
|
||||
if [[ -e "${SCRIPTS_DIR_OLD}" ]]; then
|
||||
chown -R 0:0 "${SCRIPTS_DIR_OLD}"
|
||||
fi
|
||||
|
||||
# chown legacy folders if they exist
|
||||
if [[ -e "${SERVICES_DIR_OLD}" ]]; then
|
||||
chown -R 0:0 "${SERVICES_DIR_OLD}"
|
||||
fi
|
||||
|
||||
# Make sure custom init directory exists and has files in it
|
||||
if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]]; then
|
||||
echo "[custom-init] Files found, executing"
|
||||
|
|
@ -30,27 +17,6 @@ if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)"
|
|||
echo "[custom-init] ${NAME}: is not a file"
|
||||
fi
|
||||
done
|
||||
|
||||
# Remove legacy folder if it's empty
|
||||
if [[ -e "${SCRIPTS_DIR_OLD}" ]] && [[ -z "$(/bin/ls -A ${SCRIPTS_DIR_OLD} 2>/dev/null)" ]]; then
|
||||
echo "[custom-init] Legacy files folder ${SCRIPTS_DIR_OLD} is empty, deleting..."
|
||||
rm -rf "${SCRIPTS_DIR_OLD}"
|
||||
fi
|
||||
elif [[ -e "${SCRIPTS_DIR_OLD}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR_OLD} 2>/dev/null)" ]]; then
|
||||
echo "[custom-init] Files found, executing"
|
||||
for SCRIPT in "${SCRIPTS_DIR_OLD}"/*; do
|
||||
NAME="$(basename "${SCRIPT}")"
|
||||
if [[ -f "${SCRIPT}" ]]; then
|
||||
echo "[custom-init] ${NAME}: executing..."
|
||||
/bin/bash "${SCRIPT}"
|
||||
echo "[custom-init] ${NAME}: exited $?"
|
||||
elif [[ ! -f "${SCRIPT}" ]]; then
|
||||
echo "[custom-init] ${NAME}: is not a file"
|
||||
fi
|
||||
done
|
||||
elif [[ -e "${SCRIPTS_DIR_OLD}" ]] && [[ -z "$(/bin/ls -A ${SCRIPTS_DIR_OLD} 2>/dev/null)" ]]; then
|
||||
echo "[custom-init] Legacy files folder ${SCRIPTS_DIR_OLD} is empty, deleting..."
|
||||
rm -rf "${SCRIPTS_DIR_OLD}"
|
||||
else
|
||||
echo "[custom-init] No custom files found, skipping..."
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
if [[ -n "$(/bin/ls -A "/config/custom-cont-init.d" 2>/dev/null)" ]] ||
|
||||
[[ -n "$(/bin/ls -A "/config/custom-services.d" 2>/dev/null)" ]]; then
|
||||
cat << EOF | tee /config/custom-cont-init.d/README.txt 2>/dev/null
|
||||
********************************************************
|
||||
********************************************************
|
||||
* *
|
||||
* !!!! *
|
||||
* Custom scripts or services found in legacy locations *
|
||||
* !!!! *
|
||||
* Please move your custom scripts and services *
|
||||
* to /custom-cont-init.d and /custom-services.d *
|
||||
* respectively to ensure they continue working. *
|
||||
* *
|
||||
* Visit https://linuxserver.io/custom for more info. *
|
||||
* *
|
||||
********************************************************
|
||||
********************************************************
|
||||
EOF
|
||||
fi
|
||||
exit 0
|
||||
|
|
@ -1 +0,0 @@
|
|||
oneshot
|
||||
|
|
@ -1 +0,0 @@
|
|||
/etc/s6-overlay/s6-rc.d/init-script-check/run
|
||||
Loading…
Reference in a new issue