mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
HEALTHCHECK operation
Signed-off-by: Erik Hollensbe <git@hollensbe.org>
This commit is contained in:
parent
c30a1f60ea
commit
d52ebaa412
2 changed files with 10 additions and 7 deletions
|
@ -22,5 +22,7 @@ RUN rm -rf /var/lib/zerotier-one
|
||||||
COPY entrypoint.sh.release /entrypoint.sh
|
COPY entrypoint.sh.release /entrypoint.sh
|
||||||
RUN chmod 755 /entrypoint.sh
|
RUN chmod 755 /entrypoint.sh
|
||||||
|
|
||||||
|
HEALTHCHECK CMD bash /healthcheck.sh
|
||||||
|
|
||||||
CMD []
|
CMD []
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
|
@ -65,15 +65,16 @@ do
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Ensuring status for networks: $@"
|
echo "Writing healthcheck for networks: $@"
|
||||||
|
|
||||||
for i in "$@"
|
cat >/healthcheck.sh <<EOF
|
||||||
|
#!/bin/bash
|
||||||
|
for i in $@
|
||||||
do
|
do
|
||||||
while [ "$(zerotier-cli get $i status)" != "OK" ]
|
[ "\$(zerotier-cli get \$i status)" = "OK" ] || exit 1
|
||||||
do
|
|
||||||
echo "joining $i failed (are they added in central?); trying again in 1s"
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
done
|
done
|
||||||
|
EOF
|
||||||
|
|
||||||
|
chmod +x /healthcheck.sh
|
||||||
|
|
||||||
sleep infinity
|
sleep infinity
|
||||||
|
|
Loading…
Add table
Reference in a new issue