Fix: Erweiter neustart-Logik
This commit is contained in:
parent
b3dedd446f
commit
f952e4df25
@ -14,7 +14,7 @@ trap trap_remove_lock SIGINT SIGTERM
|
||||
create_lock
|
||||
|
||||
# === KONSTANTEN ===
|
||||
MAX_RESTARTS=2 # Maximale Anzahl an Neustarts
|
||||
MAX_RESTARTS=10 # Maximale Anzahl an Neustarts
|
||||
RESTART_COUNT_FILE="/tmp/hidrive_restart_count" # Datei zur Speicherung des Neustart-Zählers
|
||||
|
||||
# === Neustart-Zähler initialisieren ===
|
||||
@ -86,6 +86,7 @@ restart_script() {
|
||||
RESTART_COUNT=$((RESTART_COUNT + 1))
|
||||
echo "$RESTART_COUNT" >"$RESTART_COUNT_FILE"
|
||||
log "Neustart des Skripts (Versuch $RESTART_COUNT von $MAX_RESTARTS)..."
|
||||
sleep 10
|
||||
remove_lock
|
||||
exec "$0" "$@"
|
||||
else
|
||||
@ -136,6 +137,7 @@ mount_webdav() {
|
||||
# Prüfen, ob NFS oder WebDAV installiert ist
|
||||
if ! check_nfs_installed && ! check_webdav_installed; then
|
||||
log "Weder NFS noch WebDAV sind installiert. Neustart erforderlich."
|
||||
log "Path: $PATH"
|
||||
restart_script "$@"
|
||||
fi
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user