From e1596e8b1e945a8798c8d2a52e52a21bddeb20e8 Mon Sep 17 00:00:00 2001 From: casjay Date: Fri, 26 Jun 2026 21:03:18 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20=5F=5Fcreate=5Fservice=5Fe?= =?UTF-8?q?nv=20to=20write=20.local.sh=20to=20disk=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .local.sh block defined stub functions in memory but never wrote the file to disk, so __file_exists_with_content always failed and __create_service_env returned non-zero on every run. Fix: use a heredoc to write the stub functions into .local.sh. - rootfs/usr/local/etc/docker/init.d/01-tor-server.sh: write .local.sh via heredoc in __create_service_env; bump version to 202606261600-git rootfs/usr/local/etc/docker/init.d/01-tor-server.sh rootfs/usr/local/etc/docker/init.d/02-tor-bridge.sh rootfs/usr/local/etc/docker/init.d/04-tor-exit.sh rootfs/usr/local/etc/docker/init.d/09-unbound.sh --- .../local/etc/docker/init.d/01-tor-server.sh | 41 +++++++++++-------- .../local/etc/docker/init.d/02-tor-bridge.sh | 41 +++++++++++-------- .../local/etc/docker/init.d/04-tor-exit.sh | 39 ++++++++++-------- .../usr/local/etc/docker/init.d/09-unbound.sh | 41 +++++++++++-------- 4 files changed, 91 insertions(+), 71 deletions(-) diff --git a/rootfs/usr/local/etc/docker/init.d/01-tor-server.sh b/rootfs/usr/local/etc/docker/init.d/01-tor-server.sh index 7960acb..323bd7b 100755 --- a/rootfs/usr/local/etc/docker/init.d/01-tor-server.sh +++ b/rootfs/usr/local/etc/docker/init.d/01-tor-server.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # shellcheck shell=bash # - - - - - - - - - - - - - - - - - - - - - - - - - -##@Version : 202501060902-git +##@Version : 202606261600-git # @@Author : Jason Hempstead # @@Contact : jason@casjaysdev.pro # @@License : WTFPL @@ -588,23 +588,28 @@ __create_service_env() { EOF fi if [ ! -f "/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.local.sh" ]; then - # - - - - - - - - - - - - - - - - - - - - - - - - - - __run_precopy_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __execute_prerun_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __run_pre_execute_checks_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __update_conf_files_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __pre_execute_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __post_execute_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __pre_message_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __update_ssl_conf_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - + cat <<'EOF' >"/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.local.sh" +# - - - - - - - - - - - - - - - - - - - - - - - - - +# Local overrides - sourced after the main env file. +# Redefine any of these functions to customise behaviour. +# - - - - - - - - - - - - - - - - - - - - - - - - - +__run_precopy_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__execute_prerun_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__run_pre_execute_checks_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__update_conf_files_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__pre_execute_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__post_execute_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__pre_message_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__update_ssl_conf_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +EOF fi if ! __file_exists_with_content "/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.sh"; then exitCode=$((exitCode + 1)) diff --git a/rootfs/usr/local/etc/docker/init.d/02-tor-bridge.sh b/rootfs/usr/local/etc/docker/init.d/02-tor-bridge.sh index b5ce539..3378a9b 100755 --- a/rootfs/usr/local/etc/docker/init.d/02-tor-bridge.sh +++ b/rootfs/usr/local/etc/docker/init.d/02-tor-bridge.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # shellcheck shell=bash # - - - - - - - - - - - - - - - - - - - - - - - - - -##@Version : 202605241142-git +##@Version : 202606261600-git # @@Author : Jason Hempstead # @@Contact : jason@casjaysdev.pro # @@License : WTFPL @@ -514,23 +514,28 @@ __create_service_env() { EOF fi if [ ! -f "/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.local.sh" ]; then - # - - - - - - - - - - - - - - - - - - - - - - - - - - __run_precopy_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __execute_prerun_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __run_pre_execute_checks_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __update_conf_files_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __pre_execute_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __post_execute_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __pre_message_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __update_ssl_conf_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - + cat <<'EOF' >"/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.local.sh" +# - - - - - - - - - - - - - - - - - - - - - - - - - +# Local overrides - sourced after the main env file. +# Redefine any of these functions to customise behaviour. +# - - - - - - - - - - - - - - - - - - - - - - - - - +__run_precopy_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__execute_prerun_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__run_pre_execute_checks_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__update_conf_files_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__pre_execute_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__post_execute_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__pre_message_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__update_ssl_conf_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +EOF fi if ! __file_exists_with_content "/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.sh"; then exitCode=$((exitCode + 1)) diff --git a/rootfs/usr/local/etc/docker/init.d/04-tor-exit.sh b/rootfs/usr/local/etc/docker/init.d/04-tor-exit.sh index 3002d0e..a3284ea 100755 --- a/rootfs/usr/local/etc/docker/init.d/04-tor-exit.sh +++ b/rootfs/usr/local/etc/docker/init.d/04-tor-exit.sh @@ -598,23 +598,28 @@ __create_service_env() { EOF fi if [ ! -f "/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.local.sh" ]; then - # - - - - - - - - - - - - - - - - - - - - - - - - - - __run_precopy_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __execute_prerun_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __run_pre_execute_checks_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __update_conf_files_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __pre_execute_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __post_execute_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __pre_message_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __update_ssl_conf_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - + cat <<'EOF' >"/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.local.sh" +# - - - - - - - - - - - - - - - - - - - - - - - - - +# Local overrides - sourced after the main env file. +# Redefine any of these functions to customise behaviour. +# - - - - - - - - - - - - - - - - - - - - - - - - - +__run_precopy_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__execute_prerun_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__run_pre_execute_checks_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__update_conf_files_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__pre_execute_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__post_execute_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__pre_message_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__update_ssl_conf_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +EOF fi if ! __file_exists_with_content "/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.sh"; then exitCode=$((exitCode + 1)) diff --git a/rootfs/usr/local/etc/docker/init.d/09-unbound.sh b/rootfs/usr/local/etc/docker/init.d/09-unbound.sh index 66c1983..714d96d 100755 --- a/rootfs/usr/local/etc/docker/init.d/09-unbound.sh +++ b/rootfs/usr/local/etc/docker/init.d/09-unbound.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # shellcheck shell=bash # - - - - - - - - - - - - - - - - - - - - - - - - - -##@Version : 202605241142-git +##@Version : 202606261600-git # @@Author : Jason Hempstead # @@Contact : jason@casjaysdev.pro # @@License : WTFPL @@ -452,23 +452,28 @@ __create_service_env() { EOF fi if [ ! -f "/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.local.sh" ]; then - # - - - - - - - - - - - - - - - - - - - - - - - - - - __run_precopy_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __execute_prerun_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __run_pre_execute_checks_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __update_conf_files_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __pre_execute_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __post_execute_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __pre_message_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - - __update_ssl_conf_local() { true; } - # - - - - - - - - - - - - - - - - - - - - - - - - - + cat <<'EOF' >"/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.local.sh" +# - - - - - - - - - - - - - - - - - - - - - - - - - +# Local overrides - sourced after the main env file. +# Redefine any of these functions to customise behaviour. +# - - - - - - - - - - - - - - - - - - - - - - - - - +__run_precopy_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__execute_prerun_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__run_pre_execute_checks_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__update_conf_files_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__pre_execute_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__post_execute_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__pre_message_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +__update_ssl_conf_local() { true; } +# - - - - - - - - - - - - - - - - - - - - - - - - - +EOF fi if ! __file_exists_with_content "/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.sh"; then exitCode=$((exitCode + 1))