Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions modules/lido/withdrawals-automation/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@
serviceConfig = lib.mkMerge [
{
Group = "lido";
ExecStartPre = pkgs.writeShellScript "healthcheck.sh" ''
#!/usr/bin/env bash
set -euo pipefail

while true; do
if ${lib.getExe pkgs.curl} -sSf ${cfg.args.kapi-url} > /dev/null; then
echo "${cfg.args.kapi-url} is online"
break
else
echo "${cfg.args.kapi-url} is offline, waiting..."
sleep 5 # Adjust the sleep duration as needed
fi
done
'';
ExecStart = lib.getExe (pkgs.writeShellApplication {
name = "repl";
text = ''
Expand Down