mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 10:37:33 -07:00
Pick a new random secondary port if we are offline for more than path-timeout seconds (COMA problem workaround).
This commit is contained in:
parent
b6680b18e7
commit
11b352458e
3 changed files with 54 additions and 62 deletions
|
@ -8,7 +8,17 @@ for i in `ps axuwww | tr -s ' ' ',' | grep -F '/Applications/ZeroTier,One.app' |
|
|||
p=`echo $i | cut -d , -f 2`
|
||||
if [ ! -z "$u" -a "0$p" -gt 0 ]; then
|
||||
kill $p >>/dev/null 2>&1
|
||||
sleep 0.2
|
||||
sleep 0.5
|
||||
kill -9 $p >>/dev/null 2>&1
|
||||
echo "$u" >>/tmp/zt1-gui-restart.tmp
|
||||
fi
|
||||
done
|
||||
for i in `ps axuwww | tr -s ' ' ',' | grep -F '/Applications/ZeroTier.app' | grep -F -v grep | cut -d , -f 1,2 | xargs`; do
|
||||
u=`echo $i | cut -d , -f 1`
|
||||
p=`echo $i | cut -d , -f 2`
|
||||
if [ ! -z "$u" -a "0$p" -gt 0 ]; then
|
||||
kill $p >>/dev/null 2>&1
|
||||
sleep 0.5
|
||||
kill -9 $p >>/dev/null 2>&1
|
||||
echo "$u" >>/tmp/zt1-gui-restart.tmp
|
||||
fi
|
||||
|
@ -17,23 +27,14 @@ chmod 0600 /tmp/zt1-gui-restart.tmp
|
|||
|
||||
if [ -f /Library/LaunchDaemons/com.zerotier.one.plist ]; then
|
||||
launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
|
||||
if [ -d "/Library/Application Support/ZeroTier/One" ]; then
|
||||
cd "/Library/Application Support/ZeroTier/One"
|
||||
if [ -f "zerotier-one.pid" ]; then
|
||||
ztpid=`cat zerotier-one.pid`
|
||||
if [ "$ztpid" -gt "0" ]; then
|
||||
kill `cat zerotier-one.pid`
|
||||
fi
|
||||
fi
|
||||
if [ -f '/Library/Application Support/ZeroTier/One/zerotier-one.pid' ]; then
|
||||
kill -9 `cat /Library/Application Support/ZeroTier/One/zerotier-one.pid`
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
|
||||
cd "/Applications"
|
||||
rm -rf "ZeroTier One.app"
|
||||
rm -rf "ZeroTier.app"
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue