🎨 Apply script conventions to caddy setup and init.d scripts 🎨

Fix violations of script_conventions.md in the three scripts edited
during the /config/ architecture migration.
- rootfs/root/docker/setup/03-files.sh: collapse multiple shellcheck disable lines into single canonical line; remove commented-out exitCode line; add
This commit is contained in:
2026-06-04 12:59:46 -04:00
parent a31c2542bd
commit f319a21ab9
3 changed files with 63 additions and 61 deletions
+14 -26
View File
@@ -3,46 +3,37 @@
##@Version : 202606041215-git
# @@Author : CasjaysDev
# @@Contact : CasjaysDev <docker-admin@casjaysdev.pro>
# @@License : MIT
# @@License : WTFPL
# @@ReadME :
# @@Copyright : Copyright 2023 CasjaysDev
# @@Copyright : Copyright: (c) 2023 CasjaysDev
# @@Created : Mon Aug 28 06:48:42 PM EDT 2023
# @@File : 03-files.sh
# @@Description : script to run files
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# shellcheck shell=bash
# shellcheck disable=SC2016
# shellcheck disable=SC2031
# shellcheck disable=SC2120
# shellcheck disable=SC2155
# shellcheck disable=SC2199
# shellcheck disable=SC2317
# shellcheck disable=SC1001,SC1003,SC2001,SC2003,SC2016,SC2031,SC2090,SC2115,SC2120,SC2155,SC2199,SC2229,SC2317,SC2329
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set bash options
set -o pipefail
[ "$DEBUGGER" = "on" ] && echo "Enabling debugging" && set -x$DEBUGGER_OPTIONS
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set env variables
exitCode=0
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Predefined actions
if [ -d "/tmp/bin" ]; then
mkdir -p "/usr/local/bin"
\mkdir -p "/usr/local/bin"
for bin in "/tmp/bin"/*; do
name="$(basename -- "$bin")"
name="${bin##*/}"
echo "Installing $name to /usr/local/bin/$name"
copy "$bin" "/usr/local/bin/$name"
chmod -f +x "/usr/local/bin/$name"
\chmod -f +x "/usr/local/bin/$name"
done
fi
unset bin
if [ -d "/tmp/var" ]; then
for var in "/tmp/var"/*; do
name="$(basename -- "$var")"
name="${var##*/}"
echo "Installing $var to /var/$name"
if [ -d "$var" ]; then
mkdir -p "/var/$name"
\mkdir -p "/var/$name"
copy "$var/." "/var/$name/"
else
copy "$var" "/var/$name"
@@ -52,10 +43,10 @@ fi
unset var
if [ -d "/tmp/etc" ]; then
for config in "/tmp/etc"/*; do
name="$(basename -- "$config")"
name="${config##*/}"
echo "Installing $config to /etc/$name"
if [ -d "$config" ]; then
mkdir -p "/etc/$name"
\mkdir -p "/etc/$name"
copy "$config/." "/etc/$name/"
else
copy "$config" "/etc/$name"
@@ -65,10 +56,10 @@ fi
unset config
if [ -d "/tmp/usr" ]; then
for usrpath in "/tmp/usr"/*; do
name="$(basename -- "$usrpath")"
name="${usrpath##*/}"
echo "Installing $usrpath to /usr/$name"
if [ -d "$usrpath" ]; then
mkdir -p "/usr/$name"
\mkdir -p "/usr/$name"
copy "$usrpath/." "/usr/$name/"
else
copy "$usrpath" "/usr/$name"
@@ -77,10 +68,7 @@ if [ -d "/tmp/usr" ]; then
fi
unset usrpath
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Main script
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set the exit code
#exitCode=$?
exitCode=$?
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exit $exitCode
# ex: ts=2 sw=2 et filetype=sh