From 94b2ad897101e9932c5f8b8208f7ab159ac2a545 Mon Sep 17 00:00:00 2001 From: casjay Date: Wed, 22 Oct 2025 10:05:12 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Update=20codebase=20?= =?UTF-8?q?=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh rootfs/usr/local/etc/docker/init.d/03-tor-server.sh rootfs/usr/local/etc/docker/functions/entrypoint.sh rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh rootfs/usr/local/etc/docker/init.d/03-tor-server.sh --- rootfs/usr/local/etc/docker/functions/entrypoint.sh | 7 +------ rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh | 2 +- rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh | 2 +- rootfs/usr/local/etc/docker/init.d/03-tor-server.sh | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/rootfs/usr/local/etc/docker/functions/entrypoint.sh b/rootfs/usr/local/etc/docker/functions/entrypoint.sh index 1a8ff08..651d559 100644 --- a/rootfs/usr/local/etc/docker/functions/entrypoint.sh +++ b/rootfs/usr/local/etc/docker/functions/entrypoint.sh @@ -798,19 +798,14 @@ __start_init_scripts() { fi else # Service uses PID tracking - verify actual running processes - set +e # Temporarily disable exit on error retPID="" - # First, try to find actual running process with various name patterns - for name_variant in "$service" "${service}84" "${service}d" "$(echo "$service" | sed 's/-//g')" "$(echo "$service" | tr -d '-')"; do + for name_variant in "$service" "${service//-*/}" "${service//-/_}"; do if [ -z "$retPID" ]; then retPID=$(__get_pid "$name_variant" 2>/dev/null || echo "") [ -n "$retPID" ] && found_process="$name_variant" && break fi done - - set -e # Re-enable exit on error - if [ -n "$retPID" ] && [ "$retPID" != "0" ]; then # Found actual running process initStatus="0" diff --git a/rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh b/rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh index 5f7d65f..233b78c 100755 --- a/rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh +++ b/rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh @@ -201,7 +201,7 @@ __run_precopy() { # Define environment local hostname=${HOSTNAME} # Define actions/commands - [ -d "$DATA_DIR" ] && mkdir -p "$DATA_DIR" + [ -d "$DATA_DIR" ] || mkdir -p "$DATA_DIR" # allow custom functions if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi diff --git a/rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh b/rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh index cc2bf57..0f77c21 100755 --- a/rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh +++ b/rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh @@ -201,7 +201,7 @@ __run_precopy() { # Define environment local hostname=${HOSTNAME} # Define actions/commands - [ -d "$DATA_DIR" ] && mkdir -p "$DATA_DIR" + [ -d "$DATA_DIR" ] || mkdir -p "$DATA_DIR" # allow custom functions if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi diff --git a/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh b/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh index ea51560..a18606b 100755 --- a/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh +++ b/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh @@ -201,7 +201,7 @@ __run_precopy() { # Define environment local hostname=${HOSTNAME} # Define actions/commands - [ -d "$DATA_DIR" ] && mkdir -p "$DATA_DIR" + [ -d "$DATA_DIR" ] || mkdir -p "$DATA_DIR" # allow custom functions if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi