mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-20 05:28:01 +00:00
31 lines
456 B
Plaintext
31 lines
456 B
Plaintext
|
#!/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
|