Compare commits

..

2 Commits

2 changed files with 20 additions and 0 deletions

View File

@ -2,7 +2,9 @@
# === IMPORTS ===
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../Utility/IsWebdavMounted.sh"
source "$SCRIPT_DIR/../Utility/WakeOnLan.sh"
source "$SCRIPT_DIR/../Utility/IsMounted.sh"
source "$SCRIPT_DIR/../Utility/Log.sh"
# === Hilfe-Seite ===
@ -97,6 +99,14 @@ mount_webdav() {
}
# === HAUPTLOGIK ===
# Prüfen, ob das Dateisystem bereits gemountet ist
if is_mounted "$MOUNT_POINT"; then
log "Das Dateisystem ist bereits gemountet unter $MOUNT_POINT."
exit 0 # Skript beenden, da kein weiteres Mounten erforderlich ist
fi
# Wenn nicht gemountet, mit der Hauptlogik fortfahren
log "Starte Wake-on-LAN-Prozess..."
DEVICE_IP=$(wake_device "$DEVICE_MAC")

10
Utility/IsMounted.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
is_mounted() {
local mount_point="$1"
if mount | grep -q "on $mount_point type"; then
return 0 # Bereits gemountet
else
return 1 # Nicht gemountet
fi
}