Replace the central app-name if-ladder in app_update_specifics.sh with a generic dispatcher: each app ships containers/<app>/scripts/<app>_update_specifics.sh defining appUpdateSpecifics_<app> (live-sourced by the container scan, dispatched by `declare -F` — same pattern as tools). A hook may set shouldrestart=true. Apps with no specifics ship no hook. - Move the adguard/pihole (DNS updater), dashy (conf refresh), focalboard (nobody ownership + restart), and libreportal (webui regen) branches to per-app hooks. - Move scripts/gluetun/gluetun_route_apps.sh -> containers/gluetun/scripts/ (scripts/gluetun/ removed). - Move scripts/install/install_crowdsec.sh -> containers/crowdsec/scripts/ crowdsec_install_host.sh; fix the path note in crowdsec.sh. - Regenerate arrays (moved files drop out; the per-app files are container-scanned, not arrayed). Dispatch verified with stubs: adguard/pihole/dashy/focalboard/libreportal behave identically to the old ladder (incl. shouldrestart propagation), apps without a hook are a clean no-op. The CLI itself had no per-app branches — app-specific CLI is already the (now fully modular) tools system. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
25 lines
780 B
Bash
Executable File
25 lines
780 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Generic post-install/update dispatcher. App-specific behavior lives WITH the app:
|
|
# containers/<app>/scripts/<app>_update_specifics.sh defines appUpdateSpecifics_<app>
|
|
# (live-sourced by the container scan). A hook may set shouldrestart=true to request
|
|
# a container restart. Apps with no specifics simply ship no hook.
|
|
appUpdateSpecifics()
|
|
{
|
|
local app_name="$1"
|
|
|
|
# Initialize setup (loads CFG_* for the hook to read).
|
|
initializeAppVariables $app_name;
|
|
|
|
local hook="appUpdateSpecifics_${app_name}"
|
|
if declare -F "$hook" >/dev/null 2>&1; then
|
|
"$hook" "$app_name"
|
|
fi
|
|
|
|
if [[ $shouldrestart == "true" ]]; then
|
|
dockerComposeRestart $app_name;
|
|
fi
|
|
|
|
isSuccessful "All application specific updates have been completed."
|
|
}
|