mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-20 21:43:08 +00:00
ef784611b7
Signed-off-by: Erik Hollensbe <github@hollensbe.org>
31 lines
456 B
Bash
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
|