Feat: Mounten von OneDrive mithilfe von rclone

This commit is contained in:
DragonSlayer_14 2025-03-03 22:18:35 +01:00
parent f37f91ead9
commit af5417c175

32
Mount/OneDrive.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
# === IMPORTS ===
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../Utility/NetworkCheck.sh"
source "$SCRIPT_DIR/../Utility/Log.sh"
# === Variablen ===
MOUNT_POINT="/media/OneDrive"
PROFILE_NAME="OneDrive"
# === Hauptskript ===
wait_for_internet_connection
if rclone listremotes | grep -q "^${PROFILE_NAME}:"; then
mkdir -p "$MOUNT_POINT"
if rclone listremotes | grep -q "^${PROFILE_NAME}:"; then
mkdir -p "$MOUNT_POINT"
if rclone mount "${PROFILE_NAME}:" "$MOUNT_POINT" --vfs-cache-mode writes --daemon; then
log "${PROFILE_NAME} wurde eingehängt."
else
log "Fehler beim Ausführen von rclone. Überprüfen Sie die rclone-Konfiguration und versuchen Sie es erneut."
fi
else
log "Kein rclone-Profil mit dem Namen '${PROFILE_NAME}' gefunden."
fi
else
log "Kein rclone-Profil mit dem Namen '${PROFILE_NAME}' gefunden."
fi