From 0752ff3f7529234310964bec293dbc97c5825114 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 15 Jan 2023 09:48:22 -0600 Subject: [PATCH] Format shell scripts --- root/etc/cont-init.d/50-config | 3 ++- root/etc/services.d/memcached/run | 2 ++ root/migrations/02-default-location | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 634e127..90dd0e0 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash if [ -d /app/www-tmp ]; then echo "New container detected. Setting up app folder and fixing permissions." @@ -123,7 +124,7 @@ fi # check for the mysql endpoint echo "Waiting for DB to be available" -END=$((SECONDS+30)) +END=$((SECONDS + 30)) while [[ ${SECONDS} -lt ${END} ]] && [[ -n "${DB_HOST+x}" ]]; do if [[ $(/usr/bin/nc -w1 "${DB_HOST}" "${DB_PORT}" | tr -d '\0') ]]; then if [[ -n "${RUN}" ]]; then diff --git a/root/etc/services.d/memcached/run b/root/etc/services.d/memcached/run index bd4a49e..4ba399b 100644 --- a/root/etc/services.d/memcached/run +++ b/root/etc/services.d/memcached/run @@ -1,2 +1,4 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash + exec memcached -u abc diff --git a/root/migrations/02-default-location b/root/migrations/02-default-location index 7f0e6f3..7347d24 100644 --- a/root/migrations/02-default-location +++ b/root/migrations/02-default-location @@ -1,10 +1,11 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash DEFAULT_CONF="/config/nginx/site-confs/default.conf" OLD_ROOT="root /var/www/html/public;" NEW_ROOT="root /app/www/public;" -if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}";then +if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}"; then echo "updating root in ${DEFAULT_CONF}" sed -i "s|${OLD_ROOT}|${NEW_ROOT}|" "${DEFAULT_CONF}" fi