Add full banner headers to all scripts across the codebase

Every script now has the established header format: PURPOSE with ─────── separator,
OPERATIONAL MODEL, DESIGN PRINCIPLES, OPERATIONAL SAFEGUARDS, CONFIGURATION, and
RUNTIME MODES — structured with full ====== banner sections throughout.

Orchestrators converted from compact ── inline format to full banners. Stale
emby-fallback and dirty sync references removed from Plugin/user_script_plug-in.sh.
This commit is contained in:
Gmer4Lfe
2026-06-26 18:50:05 -04:00
parent 1003bee72a
commit f92ee4064b
51 changed files with 1822 additions and 563 deletions
+51 -15
View File
@@ -2,32 +2,68 @@
# ==============================================================================================
# ================================= System Watchdog ============================================
# ==============================================================================================
#
# PURPOSE
# ─────────────────────────────────────────────────────────────────────────────
# Thin orchestrator — runs SYSTEM_WATCHDOG_SCRIPTS from master.conf sequentially.
# Called by watchdog_orchestrator.sh each cycle. Covers system component health:
# storage pool growth, runaway logs, WebGUI availability, and network connectivity.
#
# ── EXECUTION ORDER ───────────────────────────────────────────────────────────────────────────
# Driven by SYSTEM_WATCHDOG_SCRIPTS in master.conf — add, remove, or reorder there.
# Default: storage_watchdog → webgui_watchdog → network_watchdog
# ==============================================================================================
# OPERATIONAL MODEL
# ==============================================================================================
#
# Driven by SYSTEM_WATCHDOG_SCRIPTS in master.conf — add, remove, or reorder there.
# Default: storage_watchdog → webgui_watchdog → network_watchdog
#
# ── SEQUENTIAL EXECUTION ─────────────────────────────────────────────────────────────────────
# All scripts run in the foreground. Each must complete before the next starts.
# A failed script is logged but does not prevent remaining scripts from running.
#
# ── SAFEGUARDS ────────────────────────────────────────────────────────────────────────────────
# Root check — child scripts require root
# acquire_lock — prevents concurrent system watchdog runs
# detect_hosts() — MY_ID in notifications and logs
# Non-fatal steps — a failed step is logged; remaining steps still run
# ==============================================================================================
# DESIGN PRINCIPLES
# ==============================================================================================
#
# Configuration Owns the List
# SYSTEM_WATCHDOG_SCRIPTS in master.conf is the only place scripts are added
# or removed. This orchestrator never needs to be edited to change what runs.
#
# Non-Fatal Steps
# A failed watchdog step is logged and noted in the summary, but the remaining
# steps still execute. Partial coverage is better than a halted watchdog chain.
#
# ==============================================================================================
# OPERATIONAL SAFEGUARDS
# ==============================================================================================
#
# Root check — child scripts require root
# acquire_lock — prevents concurrent system watchdog runs
# detect_hosts() — MY_ID in notifications and logs
# Non-fatal steps — a failed step is logged; remaining steps still run
#
# ==============================================================================================
# CONFIGURATION
# ==============================================================================================
#
# master.conf
#
# ── CONFIGURATION (master.conf) ───────────────────────────────────────────────────────────────
# SYSTEM_WATCHDOG_SCRIPTS — ordered list of system component watchdog scripts to run
#
# ── USAGE ─────────────────────────────────────────────────────────────────────────────────────
# system_watchdog.sh — run all system component watchdogs
# system_watchdog.sh --dry-run — preview without running anything
# system_watchdog.sh --status — show configured scripts and exit
# system_watchdog.sh --log — verbose output
# ==============================================================================================
# RUNTIME MODES
# ==============================================================================================
#
# system_watchdog.sh
# Run all system component watchdogs.
#
# system_watchdog.sh --dry-run
# Preview without running anything.
#
# system_watchdog.sh --status
# Show configured scripts and exit.
#
# system_watchdog.sh --log
# Verbose output.
#
# ==============================================================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"