ZeroTierOne/entrypoint.sh.release
Erik Hollensbe ef784611b7 Initial docker release image tooling
Signed-off-by: Erik Hollensbe <github@hollensbe.org>
2021-02-24 03:43:45 -08:00

31 lines
456 B
Bash

#!/bin/sh
grepzt() {
(find /proc -name exe | xargs -I{} readlink {}) 2>/dev/null | grep -q zerotier-one
return $?
}
echo "starting zerotier"
setsid /usr/sbin/zerotier-one &
while ! grepzt
do
echo "zerotier hasn't started, waiting a second"
sleep 1
done
echo "joining networks"
for i in "$@"
do
echo "joining $i"
while ! zerotier-cli join "$i"
do
echo "joining $i failed; trying again in 1s"
sleep 1
done
done
sleep infinity