Separate global and OS-specific config

This commit is contained in:
Manuel Thalmann 2024-09-22 17:50:05 +02:00
parent 4fe88bba12
commit d0b055140e
15 changed files with 101 additions and 61 deletions
scripts/Common/Software/rclone

View file

@ -9,8 +9,8 @@ begin
function userConfig -V dir -a name
source "$dir/../../Scripts/config.fish"
set -l key "valhalla.linux.users.$name.rclone.configurations"
set -l configs (getConfig "$key" --apply "builtins.attrNames" --json)
set -l key "rclone.configurations"
set -l configs (getUserConfig "$name" "$key" --apply "builtins.attrNames" --json)
if [ (echo "$configs" | jq "length") -gt 0 ]
if [ "$XDG_SESSION_TYPE" = "tty" ]
@ -89,10 +89,10 @@ begin
set -l configKey "$key.$config"
set -l duration "$configKey.cacheDuration"
set -l serviceName "rclone@$config:$(getConfig "$configKey.dirName")"
set -l serviceName "rclone@$config:$(getUserConfig "$name" "$configKey.dirName")"
if isSet "$duration"
set serviceName "$serviceName:$(getConfig "$duration")"
if isUserSet "$name" "$duration"
set serviceName "$serviceName:$(getUserConfig "$name" "$duration")"
end
echo "Please create a remote called `$config`."