l sync-containers3: don't start if consul fails

This commit is contained in:
lassulus 2022-12-30 23:37:46 +01:00
parent 3918ad6cf8
commit 4591d70e1c

View File

@ -135,7 +135,8 @@ in {
;;
200)
# echo 'got 200 from kv, will check payload'
export payload=$(consul kv get containers/${ctr.name})
payload=$(consul kv get containers/${ctr.name}) || continue
export payload
if [ "$(jq -rn 'env.payload | fromjson.host')" = '${config.networking.hostName}' ]; then
# echo 'we are the host, trying to reach container'
if $(retry -t 10 -d 10 -- /run/wrappers/bin/ping -q -c 1 ${ctr.name}.r > /dev/null); then