Update install-service.sh

This commit is contained in:
Thorsten Spille
2025-07-23 13:38:16 +02:00
committed by GitHub
parent 035de4e296
commit b9c47b835a

View File

@@ -389,13 +389,37 @@ _info() {
} }
# --- Main Execution Logic --- # --- Main Execution Logic ---
# This part is executed by the Zamba LXC Toolbox framework, # Dieser Block wird nur ausgeführt, wenn das Skript direkt aufgerufen wird,
# which calls the _install, _configure, _setup, and _info functions in order. # nicht wenn es von der Zamba Toolbox als Bibliothek geladen wird.
# For standalone testing, you could uncomment the lines below. # Ideal für Standalone-Tests.
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
if [ "$EUID" -ne 0 ]; then
echo "[ERROR] Dieses Skript muss als Root ausgeführt werden."
exit 1
fi
# if [ "$EUID" -ne 0 ]; then # Lade Konstanten, wenn das Skript standalone läuft
# echo "[ERROR] Dieses Skript muss als Root ausgeführt werden." if [ -f ./constants-service.conf ]; then
# exit 1 source ./constants-service.conf
# fi else
# echo "[ERROR] Die Datei 'constants-service.conf' wird für den Standalone-Betrieb benötigt."
# # Load constants if runn exit 1
fi
# Setze einen Fallback-Hostnamen, falls ZAMBA_HOSTNAME nicht gesetzt ist
ZAMBA_HOSTNAME=${ZAMBA_HOSTNAME:-$(hostname -f)}
# Aktiviere den Bash Strict Mode für eine sichere Ausführung
set -euo pipefail
# Führe die Installationsphasen nacheinander aus
_install
_configure
_setup
_info
set +euo pipefail
exit 0
fi