Create rclone syncs during setup

This commit is contained in:
Manuel Thalmann 2024-07-20 13:47:07 +02:00
parent 3135643d3f
commit aa2e535968
3 changed files with 27 additions and 3 deletions
scripts/Common/Software/rclone

View file

@ -37,7 +37,21 @@ begin
rm ~"$name"/.config/plasma-welcomerc
else
echo "Please complete the setup of your rclone configurations!"
rclone config || true
for config in (echo "$configs" | jq '.[]' --raw-output0 | string split0)
set -l configKey "$key.$config"
set -l duration "$configKey.cacheDuration"
set -l serviceName "rclone@$config:$(getConfig "$configKey.dirName")"
if isSet "$duration"
set serviceName "$serviceName:$(getConfig "$duration")"
end
echo "Please create a remote called `$config`."
rclone config || true
systemctl --user enable "$serviceName" --now || true
end
end
end
end