From c1c12cbe73cb76b8a543b483aa027e5b94ec5247 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Thu, 21 May 2026 16:33:36 -0400 Subject: [PATCH] =?UTF-8?q?Fallback=20echo/log=20audit=20pass=20=E2=80=94?= =?UTF-8?q?=20fallback.sh,=20fallback=5Ftest.sh=20+=20Manual?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove setup banners from fallback.sh and fallback_test.sh. Add Host Detection to fallback.sh OPERATIONAL SAFEGUARDS; add Lock Acquisition + Host Detection to fallback_test.sh. Add output tiers section to Manual-Fallback.md documenting daemon vs one-shot output behaviour. --- Fallback/Manual-Fallback.md | 18 ++++++++++++++++++ Fallback/fallback.sh | 6 ++++-- Fallback/fallback_test.sh | 10 ++++++++-- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Fallback/Manual-Fallback.md b/Fallback/Manual-Fallback.md index 3b1931a..144bf68 100644 --- a/Fallback/Manual-Fallback.md +++ b/Fallback/Manual-Fallback.md @@ -568,6 +568,24 @@ If it has happened: --- +## ━━━ OUTPUT TIERS ━━━ + +Both scripts have two output levels controlled by `--log`. + +**fallback.sh** — daemon, runs continuously. Without `--log`, only state transitions, +warnings, errors, and the startup banner are visible. Per-cycle detail (ping results, +state evaluation) is suppressed — the daemon runs every 15–30 seconds and clean cycles +produce no output by design. State transitions are always visible because they are the +events that matter. Use `--log` when debugging why the state machine is or is not +acting. + +**fallback_test.sh** — one-shot test harness. Without `--log`, phase headers, pass/fail +results, and the final test report are always visible. Per-container checks within each +phase are suppressed. With `--log`, every check in every phase is shown. Warnings and +errors are always visible regardless of `--log`. + +--- + ## ━━━ FLAG REFERENCE ━━━ ### fallback.sh diff --git a/Fallback/fallback.sh b/Fallback/fallback.sh index 934b33b..407c0f6 100755 --- a/Fallback/fallback.sh +++ b/Fallback/fallback.sh @@ -111,6 +111,10 @@ # acquire_lock() prevents two instances running simultaneously. Both would # modify containers and DDNS independently — conflict is certain. # +# Host Detection +# detect_hosts() resolves MY_ID / REMOTE_ID from master.conf at startup. +# Exits if the host cannot be identified — prevents running on an unknown machine. +# # Silent by Default # State transitions: warn() — always visible. Healthy routine cycles: log() # — suppressed unless --log. Produces no output on clean cycles. @@ -246,8 +250,6 @@ fi # ============================================================================================== # ━━━ Setup ━━━ # ============================================================================================== -echo "" -echo "━━━ $ICON_GEAR Setup ━━━" if [[ "$EUID" -ne 0 ]]; then error "Must be run as root" diff --git a/Fallback/fallback_test.sh b/Fallback/fallback_test.sh index beea5e0..77a8d07 100644 --- a/Fallback/fallback_test.sh +++ b/Fallback/fallback_test.sh @@ -60,6 +60,14 @@ # Remote Docker Daemon Check # Pre-flight confirms remote Docker daemon is responsive before Phase 2. # +# Lock Acquisition +# acquire_lock() prevents concurrent test runs. Running two tests simultaneously +# would produce conflicting iptables rules and unreliable results. +# +# Host Detection +# detect_hosts() resolves MY_ID / REMOTE_ID from master.conf at startup. +# Exits if the host cannot be identified — prevents testing on an unknown machine. +# # ============================================================================================== # CONFIGURATION # ============================================================================================== @@ -134,8 +142,6 @@ trap cleanup EXIT # ============================================================================================== # ━━━ Setup ━━━ # ============================================================================================== -echo "" -echo "━━━ $ICON_GEAR Setup ━━━" if [[ "$EUID" -ne 0 ]]; then error "Must be run as root"