From 8b422d2cb62860f4119a8a327400af13e2db888b Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 16 Jan 2024 21:39:25 +0100 Subject: [PATCH] Improve the rclone service --- scripts/Common/Config/rclone/rclone@.service | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/Common/Config/rclone/rclone@.service b/scripts/Common/Config/rclone/rclone@.service index 78babe2c..501aeb97 100644 --- a/scripts/Common/Config/rclone/rclone@.service +++ b/scripts/Common/Config/rclone/rclone@.service @@ -9,15 +9,15 @@ ExecStart= \ bash -c ' \ target="${EXPRESSION%%":"*}"; \ dirname="${EXPRESSION#*":"}"; \ - destination="%h/.mnt/$dirname"; \ + destination="$(realpath -m --relative-base "%h/.mnt" "$dirname")"; \ mkdir -p "$destination"; \ mkdir -p /tmp/rclone; \ /usr/bin/rclone mount \ - --config=%h/.config/rclone/rclone.conf \ + --config="%h/.config/rclone/rclone.conf" \ --vfs-cache-mode full \ --log-file /tmp/rclone/$target.log \ $target: "$destination";' -ExecStop=bash -c '/bin/fusermount -zu "%h/${EXPRESSION#*":"}"' +ExecStop=bash -c '/bin/fusermount -zu "$(realpath --relative-base "%h/.mnt" "${EXPRESSION#*":"}")"' Restart=always RestartSec=10