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
|
create_lock
|
||||||
|
|
||||||
# === KONSTANTEN ===
|
# === 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
|
RESTART_COUNT_FILE="/tmp/hidrive_restart_count" # Datei zur Speicherung des Neustart-Zählers
|
||||||
|
|
||||||
# === Neustart-Zähler initialisieren ===
|
# === Neustart-Zähler initialisieren ===
|
||||||
@ -86,6 +86,7 @@ restart_script() {
|
|||||||
RESTART_COUNT=$((RESTART_COUNT + 1))
|
RESTART_COUNT=$((RESTART_COUNT + 1))
|
||||||
echo "$RESTART_COUNT" >"$RESTART_COUNT_FILE"
|
echo "$RESTART_COUNT" >"$RESTART_COUNT_FILE"
|
||||||
log "Neustart des Skripts (Versuch $RESTART_COUNT von $MAX_RESTARTS)..."
|
log "Neustart des Skripts (Versuch $RESTART_COUNT von $MAX_RESTARTS)..."
|
||||||
|
sleep 10
|
||||||
remove_lock
|
remove_lock
|
||||||
exec "$0" "$@"
|
exec "$0" "$@"
|
||||||
else
|
else
|
||||||
@ -136,6 +137,7 @@ mount_webdav() {
|
|||||||
# Prüfen, ob NFS oder WebDAV installiert ist
|
# Prüfen, ob NFS oder WebDAV installiert ist
|
||||||
if ! check_nfs_installed && ! check_webdav_installed; then
|
if ! check_nfs_installed && ! check_webdav_installed; then
|
||||||
log "Weder NFS noch WebDAV sind installiert. Neustart erforderlich."
|
log "Weder NFS noch WebDAV sind installiert. Neustart erforderlich."
|
||||||
|
log "Path: $PATH"
|
||||||
restart_script "$@"
|
restart_script "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user