Skip to content

Commit 7551b3b

Browse files
committed
Check custom files are executable before running
1 parent eafa69f commit 7551b3b

File tree

1 file changed

+3
-3
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-custom-files

1 file changed

+3
-3
lines changed

root/etc/s6-overlay/s6-rc.d/init-custom-files/run

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)"
99
echo "[custom-init] Files found, executing"
1010
for SCRIPT in "${SCRIPTS_DIR}"/*; do
1111
NAME="$(basename "${SCRIPT}")"
12-
if [[ -f "${SCRIPT}" ]]; then
12+
if [[ -x "${SCRIPT}" ]]; then
1313
echo "[custom-init] ${NAME}: executing..."
1414
/bin/bash "${SCRIPT}"
1515
echo "[custom-init] ${NAME}: exited $?"
16-
elif [[ ! -f "${SCRIPT}" ]]; then
17-
echo "[custom-init] ${NAME}: is not a file"
16+
elif [[ ! -x "${SCRIPT}" ]]; then
17+
echo "[custom-init] ${NAME}: is not an executable file"
1818
fi
1919
done
2020
else

0 commit comments

Comments
 (0)