Improve the rclone service
This commit is contained in:
parent
b1bf448aa1
commit
12b54d0e24
1 changed files with 3 additions and 3 deletions
|
@ -9,15 +9,15 @@ ExecStart= \
|
||||||
bash -c ' \
|
bash -c ' \
|
||||||
target="${EXPRESSION%%":"*}"; \
|
target="${EXPRESSION%%":"*}"; \
|
||||||
dirname="${EXPRESSION#*":"}"; \
|
dirname="${EXPRESSION#*":"}"; \
|
||||||
destination="%h/.mnt/$dirname"; \
|
destination="$(realpath -m --relative-base "%h/.mnt" "$dirname")"; \
|
||||||
mkdir -p "$destination"; \
|
mkdir -p "$destination"; \
|
||||||
mkdir -p /tmp/rclone; \
|
mkdir -p /tmp/rclone; \
|
||||||
/usr/bin/rclone mount \
|
/usr/bin/rclone mount \
|
||||||
--config=%h/.config/rclone/rclone.conf \
|
--config="%h/.config/rclone/rclone.conf" \
|
||||||
--vfs-cache-mode full \
|
--vfs-cache-mode full \
|
||||||
--log-file /tmp/rclone/$target.log \
|
--log-file /tmp/rclone/$target.log \
|
||||||
$target: "$destination";'
|
$target: "$destination";'
|
||||||
ExecStop=bash -c '/bin/fusermount -zu "%h/${EXPRESSION#*":"}"'
|
ExecStop=bash -c '/bin/fusermount -zu "$(realpath --relative-base "%h/.mnt" "${EXPRESSION#*":"}")"'
|
||||||
|
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
|
|
Loading…
Reference in a new issue