diff --git a/root/etc/s6-overlay/s6-rc.d/init-adduser/run b/root/etc/s6-overlay/s6-rc.d/init-adduser/run index 3f97f72..55aeebf 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-adduser/run +++ b/root/etc/s6-overlay/s6-rc.d/init-adduser/run @@ -1,46 +1,46 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -PUID=${PUID:-911} -PGID=${PGID:-911} - -groupmod -o -g "$PGID" abc -usermod -o -u "$PUID" abc - -cat /etc/s6-overlay/s6-rc.d/init-adduser/branding - -if [[ -f /donate.txt ]]; then - echo ' -To support the app dev(s) visit:' - cat /donate.txt -fi -echo ' -To support LSIO projects visit: -https://www.linuxserver.io/donate/ - -─────────────────────────────────────── -GID/UID -───────────────────────────────────────' -echo " -User UID: $(id -u abc) -User GID: $(id -g abc) -─────────────────────────────────────── -" - -if [[ "$(uname -m)" == "armv7l" ]] || [[ "$(uname -m)" == "armhf" ]]; then - echo ' -╔═════════════════════════════════════════════════════╗ -║ ║ -║ The 32-bit Arm version of this image will ║ -║ no longer be supported after 2023-07-01 ║ -║ ║ -║ See: https://linuxserver.io/armhf ║ -║ for more details ║ -║ ║ -╚═════════════════════════════════════════════════════╝ -' -fi - -lsiown abc:abc /app -lsiown abc:abc /config -lsiown abc:abc /defaults +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +PUID=${PUID:-911} +PGID=${PGID:-911} + +groupmod -o -g "$PGID" abc +usermod -o -u "$PUID" abc + +cat /etc/s6-overlay/s6-rc.d/init-adduser/branding + +if [[ -f /donate.txt ]]; then + echo ' +To support the app dev(s) visit:' + cat /donate.txt +fi +echo ' +To support LSIO projects visit: +https://www.linuxserver.io/donate/ + +─────────────────────────────────────── +GID/UID +───────────────────────────────────────' +echo " +User UID: $(id -u abc) +User GID: $(id -g abc) +─────────────────────────────────────── +" + +if [[ "$(uname -m)" == "armv7l" ]] || [[ "$(uname -m)" == "armhf" ]]; then + echo ' +╔═════════════════════════════════════════════════════╗ +║ ║ +║ The 32-bit Arm version of this image will ║ +║ no longer be supported after 2023-07-01 ║ +║ ║ +║ See: https://linuxserver.io/armhf ║ +║ for more details ║ +║ ║ +╚═════════════════════════════════════════════════════╝ +' +fi + +lsiown abc:abc /app +lsiown abc:abc /config +lsiown abc:abc /defaults 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 dcdf5a4..3d8a17e 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 @@ -1,22 +1,22 @@ -#!/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 [[ -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 -else - echo "[custom-init] No custom files found, skipping..." -fi +#!/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 [[ -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 +else + echo "[custom-init] No custom files found, skipping..." +fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-envfile/run b/root/etc/s6-overlay/s6-rc.d/init-envfile/run index 608d352..5dbf809 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-envfile/run +++ b/root/etc/s6-overlay/s6-rc.d/init-envfile/run @@ -1,17 +1,17 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -if find /run/s6/container_environment/*"FILE__"* -maxdepth 1 > /dev/null 2>&1; then - for FILENAME in /run/s6/container_environment/*; do - if [[ "${FILENAME##*/}" == "FILE__"* ]]; then - SECRETFILE=$(cat "${FILENAME}") - if [[ -f ${SECRETFILE} ]]; then - FILESTRIP=${FILENAME//FILE__/} - cat "${SECRETFILE}" >"${FILESTRIP}" - echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}" - else - echo "[env-init] cannot find secret in ${FILENAME##*/}" - fi - fi - done -fi +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +if find /run/s6/container_environment/*"FILE__"* -maxdepth 1 > /dev/null 2>&1; then + for FILENAME in /run/s6/container_environment/*; do + if [[ "${FILENAME##*/}" == "FILE__"* ]]; then + SECRETFILE=$(cat "${FILENAME}") + if [[ -f ${SECRETFILE} ]]; then + FILESTRIP=${FILENAME//FILE__/} + cat "${SECRETFILE}" >"${FILESTRIP}" + echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}" + else + echo "[env-init] cannot find secret in ${FILENAME##*/}" + fi + fi + done +fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-migrations/run b/root/etc/s6-overlay/s6-rc.d/init-migrations/run index 0a4d08a..ff0874b 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-migrations/run +++ b/root/etc/s6-overlay/s6-rc.d/init-migrations/run @@ -1,34 +1,34 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -MIGRATIONS_DIR="/migrations" -MIGRATIONS_HISTORY="/config/.migrations" - -echo "[migrations] started" - -if [[ ! -d ${MIGRATIONS_DIR} ]]; then - echo "[migrations] no migrations found" - exit -fi - -for MIGRATION in $(find ${MIGRATIONS_DIR}/* | sort -n); do - NAME="$(basename "${MIGRATION}")" - if [[ -f ${MIGRATIONS_HISTORY} ]] && grep -Fxq "${NAME}" ${MIGRATIONS_HISTORY}; then - echo "[migrations] ${NAME}: skipped" - continue - fi - echo "[migrations] ${NAME}: executing..." - chmod +x "${MIGRATION}" - EXIT_CODE=$( - /bin/bash "${MIGRATION}" - echo $? - ) - if [[ ${EXIT_CODE} -ne 0 ]]; then - echo "[migrations] ${NAME}: failed with exit code ${EXIT_CODE}, contact support" - exit "${EXIT_CODE}" - fi - echo "${NAME}" >>${MIGRATIONS_HISTORY} - echo "[migrations] ${NAME}: succeeded" -done - -echo "[migrations] done" +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +MIGRATIONS_DIR="/migrations" +MIGRATIONS_HISTORY="/config/.migrations" + +echo "[migrations] started" + +if [[ ! -d ${MIGRATIONS_DIR} ]]; then + echo "[migrations] no migrations found" + exit +fi + +for MIGRATION in $(find ${MIGRATIONS_DIR}/* | sort -n); do + NAME="$(basename "${MIGRATION}")" + if [[ -f ${MIGRATIONS_HISTORY} ]] && grep -Fxq "${NAME}" ${MIGRATIONS_HISTORY}; then + echo "[migrations] ${NAME}: skipped" + continue + fi + echo "[migrations] ${NAME}: executing..." + chmod +x "${MIGRATION}" + EXIT_CODE=$( + /bin/bash "${MIGRATION}" + echo $? + ) + if [[ ${EXIT_CODE} -ne 0 ]]; then + echo "[migrations] ${NAME}: failed with exit code ${EXIT_CODE}, contact support" + exit "${EXIT_CODE}" + fi + echo "${NAME}" >>${MIGRATIONS_HISTORY} + echo "[migrations] ${NAME}: succeeded" +done + +echo "[migrations] done"