2023-01-23 13:19:26 +00:00
|
|
|
#!/bin/bash
|
2023-01-23 15:11:51 +00:00
|
|
|
provider="$1";
|
|
|
|
dirname="$2";
|
2024-04-20 10:55:58 +00:00
|
|
|
cacheDuration="$3";
|
2023-01-23 15:11:51 +00:00
|
|
|
serviceName="rclone@$provider:$dirname";
|
2023-01-23 13:19:26 +00:00
|
|
|
|
2024-04-20 10:55:58 +00:00
|
|
|
if [ ! -z "${cacheDuration}" ]
|
|
|
|
then
|
|
|
|
serviceName="${serviceName}:$cacheDuration";
|
|
|
|
fi;
|
|
|
|
|
2023-01-23 13:19:26 +00:00
|
|
|
echo "Please create a remote called \`$1\`";
|
2024-03-09 20:35:06 +00:00
|
|
|
rclone config || true;
|
|
|
|
systemctl --user enable "$serviceName" --now || true;
|