mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
Enable ShellCheck and improve shell scripts
This commit is contained in:
parent
58a78d7de7
commit
e5b6374751
7 changed files with 64 additions and 42 deletions
|
|
@ -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"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue