From 10f7d78238d746cd39e7c986d2baa3646157f197 Mon Sep 17 00:00:00 2001 From: thespad Date: Tue, 11 Nov 2025 20:46:30 +0000 Subject: [PATCH] Check custom files are executable before running --- root/etc/s6-overlay/s6-rc.d/init-custom-files/run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-custom-files/run b/root/etc/s6-overlay/s6-rc.d/init-custom-files/run index 3d8a17e5..6b57858b 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-custom-files/run +++ b/root/etc/s6-overlay/s6-rc.d/init-custom-files/run @@ -9,12 +9,12 @@ if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" echo "[custom-init] Files found, executing" for SCRIPT in "${SCRIPTS_DIR}"/*; do NAME="$(basename "${SCRIPT}")" - if [[ -f "${SCRIPT}" ]]; then + if [[ -x "${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" + elif [[ ! -x "${SCRIPT}" ]]; then + echo "[custom-init] ${NAME}: is not an executable file" fi done else