Refactor rclone remote installation
This commit is contained in:
parent
520b11aa71
commit
57491fab65
4 changed files with 18 additions and 5 deletions
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
12
scripts/Common/Config/rclone/rclone.service
Normal file
12
scripts/Common/Config/rclone/rclone.service
Normal 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
|
|
@ -20,5 +20,5 @@ ExecStart= \
|
|||
$target: "%h/$dirname"'
|
||||
ExecStop=bash -c '/bin/fusermount -zu "%h/${EXPRESSION#*":"}"'
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
|
Loading…
Reference in a new issue