Merge pull request #167 from linuxserver/edge-legacy-scripts

Remove legacy scripts check
This commit is contained in:
Adam 2023-01-02 15:07:31 +00:00 committed by GitHub
commit e21ec1b264
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 3 additions and 68 deletions

View file

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
FROM alpine:3.15 as rootfs-stage
FROM alpine:3.17 as rootfs-stage
# environment
ENV REL=edge
@ -18,8 +18,6 @@ RUN \
apk add --no-cache \
bash \
curl \
patch \
tar \
tzdata \
xz

View file

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
FROM alpine:3.15 as rootfs-stage
FROM alpine:3.17 as rootfs-stage
# environment
ENV REL=edge
@ -18,8 +18,6 @@ RUN \
apk add --no-cache \
bash \
curl \
patch \
tar \
tzdata \
xz

View file

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
FROM alpine:3.15 as rootfs-stage
FROM alpine:3.17 as rootfs-stage
# environment
ENV REL=edge
@ -18,8 +18,6 @@ RUN \
apk add --no-cache \
bash \
curl \
patch \
tar \
tzdata \
xz

View file

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

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