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

30 lines
886 B
Fish
Executable file

#!/bin/env fish
begin
set -l dir (status dirname)
source "$dir/../../../lib/software.fish"
function configureSW -V dir
sudo systemctl enable --now docker
end
function userConfig
argparse -i "user=" -- $argv
sudo usermod -aG docker "$_flag_user"
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')
for service in (echo "$services" | jq '. // {} | keys[]' --raw-output0 | string split0)
if echo "$services" | SERVICE=$service jq --exit-status ".[env.SERVICE].enable" >/dev/null
fish "$dir/services/$service/main.fish" $argv
end
end
end
runInstaller $argv
end