Refactor rclone remote installation

This commit is contained in:
Manuel Thalmann 2023-04-07 14:49:41 +02:00
parent 520b11aa71
commit 57491fab65
4 changed files with 18 additions and 5 deletions

View file

@ -6,6 +6,6 @@ serviceName="rclone@$provider:$dirname";
echo "Please create a remote called \`$1\`";
rclone config;
mkdir -p "~/$dirname";
mkdir -p ~/"$dirname";
systemctl --user enable "$serviceName" --now;
systemctl --user start "$serviceName";

View file

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

View file

@ -0,0 +1,12 @@
[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'
[Install]
WantedBy=default.target

View file

@ -20,5 +20,5 @@ ExecStart= \
$target: "%h/$dirname"'
ExecStop=bash -c '/bin/fusermount -zu "%h/${EXPRESSION#*":"}"'
[Install]
WantedBy=default.target
Restart=always
RestartSec=10