32 lines
955 B
Bash
Executable File
32 lines
955 B
Bash
Executable File
#!/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 |