Refactor rclone installation

This commit is contained in:
Manuel Thalmann 2023-04-07 16:26:32 +02:00
parent 57491fab65
commit 2ccace3ba7
5 changed files with 10 additions and 8 deletions

View file

@ -8,4 +8,4 @@ rclone config;
mkdir -p ~/"$dirname";
systemctl --user start "$serviceName";
systemctl --user enable "$serviceName" --now;

View file

@ -1,3 +1,3 @@
#!/bin/bash
sudo cp "${BASH_SOURCE%/*}/rclone.service" "${BASH_SOURCE%/*}/rclone@.service" /etc/systemd/user;
sudo cp "${BASH_SOURCE%/*}/rclone.service" "${BASH_SOURCE%/*}/rclone.target" "${BASH_SOURCE%/*}/rclone@.service" /etc/systemd/user;
systemctl enable --user rclone;

View file

@ -1,12 +1,10 @@
[Unit]
Description=rclone Service Starter
Documentation=man:rclone(1)
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=bash -c 'systemctl --user start rclone@*.service'
Type=simple
ExecStart=bash -c 'systemctl --user start --no-block rclone.target'
[Install]
WantedBy=default.target

View file

@ -0,0 +1,3 @@
[Unit]
Description=rclone Mounts
Documentation=man:rclone(1)

View file

@ -1,8 +1,6 @@
[Unit]
Description=rclone: Remote FUSE filesystem for cloud storage config %i
Documentation=man:rclone(1)
After=network-online.target
Wants=network-online.target
[Service]
Type=notify
@ -22,3 +20,6 @@ ExecStop=bash -c '/bin/fusermount -zu "%h/${EXPRESSION#*":"}"'
Restart=always
RestartSec=10
[Install]
WantedBy=rclone.target