Files
pi-farm 14a1792b69
Some checks failed
/ release-and-build (push) Failing after 19s
init
2026-02-12 15:18:48 +01:00

23 lines
759 B
Plaintext

#!/usr/bin/with-contenv bash
# shellcheck shell=bash
# Directories
SCRIPTS_DIR="/custom-cont-init.d"
# 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"
for SCRIPT in "${SCRIPTS_DIR}"/*; do
NAME="$(basename "${SCRIPT}")"
if [[ -x "${SCRIPT}" ]]; then
echo "[custom-init] ${NAME}: executing..."
/bin/bash "${SCRIPT}"
echo "[custom-init] ${NAME}: exited $?"
elif [[ ! -x "${SCRIPT}" ]]; then
echo "[custom-init] ${NAME}: is not an executable file"
fi
done
else
echo "[custom-init] No custom files found, skipping..."
fi