Complete the header template across Partnership, Kernel, Deployment and Plugin
Finishes the pass: every script now documents its safeguards, and the deliberate absences in the sourced libraries are recorded so they are not "corrected" later.
This commit is contained in:
@@ -28,6 +28,19 @@
|
||||
# without a separate sync step.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# OPERATIONAL MODEL
|
||||
# ==============================================================================================
|
||||
#
|
||||
# 1. Check whether a Varaverk key already exists in the unraid-api registry
|
||||
# 2. Create or overwrite it — the registry is ephemeral, so re-registering is the norm
|
||||
# 3. Write the resulting key into this host's conf, replacing any previous value
|
||||
# 4. Report whether the key was created, refreshed, or unchanged
|
||||
#
|
||||
# Runs at array start. The registry does not survive OS updates or an unraid-api restart,
|
||||
# which is why this re-registers unconditionally rather than only when the key is missing —
|
||||
# a key present in the conf but absent from the registry is the exact failure it repairs.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# OPERATIONAL SAFEGUARDS
|
||||
# ==============================================================================================
|
||||
#
|
||||
@@ -37,6 +50,22 @@
|
||||
# dry-run mode — shows what would happen without touching anything
|
||||
#
|
||||
# ==============================================================================================
|
||||
# CONFIGURATION
|
||||
# ==============================================================================================
|
||||
#
|
||||
# host*.conf
|
||||
#
|
||||
# HOST*_UNRAID_API_KEY
|
||||
# Written by this script every array start. Read by the plugin's PHP for enhanced
|
||||
# monitoring. Treated as output, not input — an existing value is always replaced,
|
||||
# because a conf value that no longer matches the registry is precisely the broken
|
||||
# state this exists to fix.
|
||||
#
|
||||
# Platform-owned:
|
||||
#
|
||||
# The unraid-api service registry — ephemeral, cleared by OS updates and service restarts.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# RUNTIME MODES
|
||||
# ==============================================================================================
|
||||
#
|
||||
@@ -56,6 +85,10 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/../../../load_config.sh"
|
||||
|
||||
parse_args "$@"
|
||||
|
||||
# Rewrites the API key into host*.conf and registers it with the unraid-api service.
|
||||
[[ "$EUID" -ne 0 ]] && { error "Must be run as root"; exit 1; }
|
||||
|
||||
acquire_lock
|
||||
detect_hosts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user