Enable ShellCheck and improve shell scripts

This commit is contained in:
SebastianStork 2025-09-12 19:32:48 +02:00
parent 58a78d7de7
commit e5b6374751
7 changed files with 64 additions and 42 deletions

View file

@ -31,9 +31,15 @@ in
serviceConfig.Type = "oneshot";
scriptArgs = "%i";
script = ''
${lib.getExe pkgs.curl} --fail --silent --show-error --max-time 10 --retry 5 https://hc-ping.com/$(cat ${
config.sops.secrets."healthchecks/ping-key".path
})/$(echo $1 | tr _ /)
ping_key="$(cat ${config.sops.secrets."healthchecks/ping-key".path})"
slug="$(echo "$1" | tr _ /)"
${lib.getExe pkgs.curl} \
--fail \
--silent \
--show-error \
--max-time 10 \
--retry 5 "https://hc-ping.com/$ping_key/$slug"
'';
};
}