2015-05-18 04:24:02 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
|
|
|
|
2017-05-03 22:03:26 +00:00
|
|
|
rm -f /tmp/zt1-gui-restart.tmp
|
|
|
|
for i in `ps axuwww | tr -s ' ' ',' | grep -F '/Applications/ZeroTier,One.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
|
2021-08-31 20:47:00 +00:00
|
|
|
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
|
2017-05-03 22:03:26 +00:00
|
|
|
kill -9 $p >>/dev/null 2>&1
|
|
|
|
echo "$u" >>/tmp/zt1-gui-restart.tmp
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
chmod 0600 /tmp/zt1-gui-restart.tmp
|
|
|
|
|
2015-05-21 02:38:49 +00:00
|
|
|
cd "/Applications"
|
2015-05-18 04:24:02 +00:00
|
|
|
rm -rf "ZeroTier One.app"
|
2021-08-31 20:47:00 +00:00
|
|
|
rm -rf "ZeroTier.app"
|
2015-05-21 02:38:49 +00:00
|
|
|
|
2021-09-02 01:55:54 +00:00
|
|
|
if [ -d '/Library/Application Support/ZeroTier/One' ]; then
|
|
|
|
cd '/Library/Application Support/ZeroTier/One'
|
|
|
|
# ensure that file locking doesn't cause issues with replacing the binary
|
|
|
|
rm -f zerotier-one
|
|
|
|
rm -f MacEthernetTapAgent
|
|
|
|
fi
|
|
|
|
|
2015-05-21 02:38:49 +00:00
|
|
|
exit 0
|