Watchdogs/ folder + host conf rename

Move all watchdog scripts to a dedicated Watchdogs/ folder:
  Docker_Essentials/docker_watchdog.sh   → Watchdogs/
  unRAID_Essentials/system_watchdog.sh   → Watchdogs/
  unRAID_Essentials/resource_watchdog.sh → Watchdogs/
  Orchestrators/watchdog_orchestrator.sh → Watchdogs/
  Tools/watchdog_skip_list_manager.sh    → Watchdogs/

Rename host config files:
  master_host1.conf → host1.conf
  master_host2.conf → host2.conf

Update all references across the ecosystem:
  master.conf: WATCHDOG_ORCHESTRATOR_SCRIPTS paths → Watchdogs/
  load_config.sh: host*.conf glob + all comments
  git_pull_execute.sh: sparse checkout glob + all comments
  Partnership/ssh_setup.sh: HOST_CONF path construction
  user_script_plug-in.sh: all script paths + per-host conf path
  common.sh, README.md, README-User_Script_Plug-in.md: comment refs
  All Partnership, Fallback, Monitors, Transcodes, Tools scripts: comment refs
This commit is contained in:
Gmer4Lfe
2026-05-22 17:08:36 -04:00
parent 9ee8af1a71
commit 95151c2278
73 changed files with 904 additions and 328 deletions
+22 -30
View File
@@ -55,11 +55,11 @@
# check_local_disk_temps() — pre-rsync temp check with exit codes 0/1/2
# stop/start local containers added alongside existing remote variants
#
# v3.1 Three-file config split — master.conf + master_host1.conf + master_host2.conf
# load_config.sh introduced — auto-discovers all master_host*.conf files
# v3.1 Three-file config split — master.conf + host1.conf + host2.conf
# load_config.sh introduced — auto-discovers all host*.conf files
# detect_hosts() rewritten — sets MY_ID/REMOTE_ID and aliases all HOST* vars
# All scripts now source load_config.sh instead of conf files directly
# Adding a new server = add master_host*.conf, zero script changes required
# Adding a new server = add host*.conf, zero script changes required
#
# v3.2 check_remote_disks() rewritten — three-tier detection:
# Tier 1: array disk paths (/mnt/disk*/sharename)
@@ -78,10 +78,6 @@
# Emby immediately removes ghost entries — no user-facing file-not-found errors
# Called by lidarr/sonarr/radarr_cleanup.sh when files are deleted
#
# v3.4 Silent-by-default output model
# info() and success() now gated by SILENT_MODE — only warn/error always visible
# Exception: monitor scripts designed to produce output stay verbose
# Reduces notification spam — ecosystem only speaks when something is wrong
#
# Three new safety functions added:
# check_unraid_version_parity() — refuses remote ops on version mismatch
@@ -190,27 +186,16 @@ ICON_SUCCESS="✅"
# ==============================================================================================
# Standardised output functions used across all scripts.
#
# Silent-by-default model:
# SILENT_MODE=true (default) — only warn() and error() produce output
# SILENT_MODE=false — all functions produce output
# --log flag — enables ENABLE_LOGGING (detailed [LOG] lines)
#
# Rules:
# error() — always visible — something broke
# warn() — always visible — something needs attention
# info() — silent by default — operational detail, visible when SILENT_MODE=false
# success() — silent by default — confirmation, visible when SILENT_MODE=false
# log() — debug detail — only when ENABLE_LOGGING=true
#
# Exception — monitor scripts are designed to produce output and set SILENT_MODE=false
# at the top of the script. All other scripts use the silent default.
# Two-tier model:
# echo — always visible — summaries, status conclusions, section headers
# warn() — always visible — state transitions, warnings, important events
# error() — always visible — something broke
# log() — only with --log flag — per-item detail, internal checks
#
# All output goes to stdout — callers can redirect as needed.
info() { [[ "${SILENT_MODE:-true}" == false ]] && echo "$ICON_INFO [INFO] $*"; return 0; }
warn() { echo "$ICON_WARN [WARN] $*"; }
error() { echo "$ICON_ERROR [ERROR] $*"; }
success() { [[ "${SILENT_MODE:-true}" == false ]] && echo "$ICON_SUCCESS [OK] $*"; return 0; }
log() {
[[ "${ENABLE_LOGGING:-false}" == true ]] && echo "[LOG] $*"
@@ -223,7 +208,7 @@ log() {
# Sends a notification via unRAID native system and/or Discord webhook.
# Both channels are optional and independently controlled:
# NOTIFY_UNRAID — shared toggle in master.conf
# MY_DISCORD_WEBHOOK — per-host in master_host*.conf, set by detect_hosts()
# MY_DISCORD_WEBHOOK — per-host in host*.conf, set by detect_hosts()
#
# Severity levels: normal, warning, alert
# Usage: notify "message" "subject" "severity"
@@ -254,7 +239,7 @@ notify() {
-d "$payload" "$MY_DISCORD_WEBHOOK" >/dev/null 2>&1; then
log "$ICON_NOTIFY Discord notification sent"
else
warn "Discord notification failed — check HOST*_DISCORD_WEBHOOK in master_host*.conf"
warn "Discord notification failed — check HOST*_DISCORD_WEBHOOK in host*.conf"
fi
fi
}
@@ -363,7 +348,7 @@ validate_int() {
# ── HOST DETECTION ────────────────────────────────────────────────────────────────────────────
# ==============================================================================================
# Determines which server is local and which is remote by comparing hostname against
# all HOST* values discovered from master_host*.conf files.
# all HOST* values discovered from host*.conf files.
#
# Sets:
# MY_ID — "HOST1" or "HOST2" (the role key, not the hostname)
@@ -384,6 +369,7 @@ validate_int() {
# WATCHDOG_REQUIRED_CONTAINERS ← HOST*_WATCHDOG_REQUIRED_CONTAINERS
# WATCHDOG_SCAN_IGNORE ← HOST*_WATCHDOG_SCAN_IGNORE
# WATCHDOG_DEPENDENCIES ← HOST*_WATCHDOG_DEPENDENCIES (associative)
# WATCHDOG_APPDATA_SIZES ← HOST*_WATCHDOG_APPDATA_SIZES (associative)
# NETWORK_CONNECT_CONTAINERS ← HOST*_NETWORK_CONNECT_CONTAINERS
# NETWORK_CONNECT_NETWORKS ← HOST*_NETWORK_CONNECT_NETWORKS
# MEDIA_PERMISSION_SHARES ← HOST*_MEDIA_PERMISSION_SHARES
@@ -423,7 +409,7 @@ detect_hosts() {
local host_var host_val
# Scan all HOST* vars that hold a hostname value
# HOST1, HOST2, HOST3 etc. — all defined in master_host*.conf files
# HOST1, HOST2, HOST3 etc. — all defined in host*.conf files
for host_var in HOST1 HOST2 HOST3 HOST4 HOST5 HOST6 HOST7 HOST8; do
host_val="${!host_var:-}"
[[ -z "$host_val" ]] && continue
@@ -435,7 +421,7 @@ detect_hosts() {
if [[ -z "$MY_ID" ]]; then
error "Unknown host: $local_hostname"
error "Hostname must match a HOST* value in master_host*.conf"
error "Hostname must match a HOST* value in host*.conf"
error "Available: $(for h in HOST1 HOST2 HOST3 HOST4; do
[[ -n "${!h:-}" ]] && echo -n "${!h} "; done)"
exit 1
@@ -459,7 +445,7 @@ detect_hosts() {
local ssh_key_var="${MY_ID}_SSH_KEY"
SSH_KEY="${!ssh_key_var:-}"
if [[ -z "$SSH_KEY" ]]; then
error "Missing SSH key: ${ssh_key_var} not set in master_host*.conf"
error "Missing SSH key: ${ssh_key_var} not set in host*.conf"
exit 1
fi
@@ -467,6 +453,11 @@ detect_hosts() {
MY_DISCORD_WEBHOOK_VAR="${MY_ID}_DISCORD_WEBHOOK"
MY_DISCORD_WEBHOOK="${!MY_DISCORD_WEBHOOK_VAR:-}"
OWNER_NAME_VAR="${MY_ID}_OWNER"
OWNER_NAME="${!OWNER_NAME_VAR:-}"
OWNER_EMAIL_VAR="${MY_ID}_OWNER_EMAIL"
OWNER_EMAIL="${!OWNER_EMAIL_VAR:-}"
EMBY_CONTAINER_VAR="${MY_ID}_EMBY_CONTAINER"
EMBY_CONTAINER="${!EMBY_CONTAINER_VAR:-}"
EMBY_URL_VAR="${MY_ID}_EMBY_URL"
@@ -598,6 +589,7 @@ detect_hosts() {
_alias_assoc "WATCHDOG_CONTAINERS"
_alias_assoc "WATCHDOG_CONTAINER_URLS"
_alias_assoc "WATCHDOG_DEPENDENCIES"
_alias_assoc "WATCHDOG_APPDATA_SIZES"
# ── Output ────────────────────────────────────────────────────────────────
info "$ICON_HOST Host: $LOCAL_SERVER_NAME$REMOTE_SERVER_NAME"
@@ -1779,7 +1771,7 @@ show_status() {
echo "Remote ID: ${REMOTE_ID:-not set}"
echo "unRAID ver: $local_ver"
echo "Profile: ${PROFILE_NAME:-n/a}"
echo "Silent mode: ${SILENT_MODE:-true}"
echo "DryRun: ${DRY_RUN:-false}"
echo "Logging: ${ENABLE_LOGGING:-false}"
echo "SSH Key: ${SSH_KEY:-not set}"