mirror of
https://github.com/bashclub/zamba-lxc-toolbox.git
synced 2025-08-02 20:25:01 +02:00
Update install-service.sh
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user