Merge pull request #165 from linuxserver/3.17-legacy-scripts

Remove legacy scripts check
This commit is contained in:
Adam 2023-01-02 16:58:01 +00:00 committed by GitHub
commit 91a498c9e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 0 additions and 65 deletions

View file

@ -18,8 +18,6 @@ RUN \
apk add --no-cache \ apk add --no-cache \
bash \ bash \
curl \ curl \
patch \
tar \
tzdata \ tzdata \
xz xz

View file

@ -18,8 +18,6 @@ RUN \
apk add --no-cache \ apk add --no-cache \
bash \ bash \
curl \ curl \
patch \
tar \
tzdata \ tzdata \
xz xz

View file

@ -18,8 +18,6 @@ RUN \
apk add --no-cache \ apk add --no-cache \
bash \ bash \
curl \ curl \
patch \
tar \
tzdata \ tzdata \
xz xz

View file

@ -2,21 +2,8 @@
# shellcheck shell=bash # shellcheck shell=bash
# Directories # Directories
SCRIPTS_DIR_OLD="/config/custom-cont-init.d"
SCRIPTS_DIR="/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 # 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 if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]]; then
echo "[custom-init] Files found, executing" 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" echo "[custom-init] ${NAME}: is not a file"
fi fi
done 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 else
echo "[custom-init] No custom files found, skipping..." echo "[custom-init] No custom files found, skipping..."
fi fi

View file

@ -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

View file

@ -1 +0,0 @@
oneshot

View file

@ -1 +0,0 @@
/etc/s6-overlay/s6-rc.d/init-script-check/run