summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2019-03-23 16:04:22 +0100
committerlassulus <lassulus@lassul.us>2019-03-23 16:04:22 +0100
commit86150b31f20772c761dac2ce76862928bcc07537 (patch)
treed4d8423cbfe80d39daad2aa8d32a06b5af7eaa3d
parent0bb9321d1b979f64703c22fa6c25a46776da50af (diff)
syncthing: wait for service startup
-rw-r--r--krebs/3modules/syncthing.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/krebs/3modules/syncthing.nix b/krebs/3modules/syncthing.nix
index 485dd399..e7f95f7f 100644
--- a/krebs/3modules/syncthing.nix
+++ b/krebs/3modules/syncthing.nix
@@ -28,6 +28,8 @@ let
updateConfig = pkgs.writeDash "merge-syncthing-config" ''
set -efu
+ # wait for service to restart
+ ${pkgs.untilport}/bin/untilport localhost 8384
API_KEY=$(${getApiKey})
CFG=$(${pkgs.curl}/bin/curl -Ss -H "X-API-Key: $API_KEY" localhost:8384/rest/system/config)
echo "$CFG" | ${pkgs.jq}/bin/jq -s '.[] * {