PortValhalla/scripts/Common/Software/docker/main.fish

31 lines
894 B
Fish
Raw Normal View History

2024-09-20 05:25:03 +00:00
#!/bin/env fish
begin
set -l dir (status dirname)
2024-11-01 12:12:16 +00:00
source "$dir/../../../lib/software.fish"
2024-09-20 05:25:03 +00:00
function configureSW -V dir
sudo systemctl enable --now docker
end
function userConfig
argparse -i "user=" -- $argv
sudo usermod -aG docker "$_flag_user"
2024-09-20 05:25:03 +00:00
end
function installSWDependencies -V dir -V args
source "$dir/../../../lib/settings.fish"
set -la argv $args
argparse -i "name=" "user=" -- $argv
set -l services (getProgramConfig --name "$_flag_name" --json | jq '.services')
2024-12-05 15:34:24 +00:00
for service in (echo "$services" | jq '. // {} | keys[]' --raw-output0 | string split0 || true)
if echo "$services" | SERVICE=$service jq --exit-status ".[env.SERVICE].enable" >/dev/null
fish "$dir/services/$service/main.fish" $argv
end
end
end
2024-09-20 05:25:03 +00:00
runInstaller $argv
end