mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
fix service command, eliminate all uses of killall since it might be missing
This commit is contained in:
parent
059aaae7a9
commit
638ae153cc
2 changed files with 17 additions and 14 deletions
|
@ -23,25 +23,24 @@ if [ -e /bin/systemctl -o -e /usr/bin/systemctl -o -e /usr/local/bin/systemctl -
|
|||
fi
|
||||
fi
|
||||
|
||||
echo
|
||||
|
||||
echo "This will uninstall ZeroTier One, hit CTRL+C to abort."
|
||||
echo "Waiting 5 seconds..."
|
||||
sleep 5
|
||||
|
||||
echo "Killing any running zerotier-one service..."
|
||||
if [ -n "$SYSTEMDUNITDIR" -a -d "$SYSTEMDUNITDIR" ]; then
|
||||
systemctl stop zerotier-one
|
||||
systemctl disable zerotier-one
|
||||
else
|
||||
if [ -f /sbin/service -o -f /usr/sbin/service -o -f /bin/service -o -f /usr/bin/service ]; then
|
||||
service stop zerotier-one
|
||||
service zerotier-one stop
|
||||
fi
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
killall -q -TERM zerotier-one
|
||||
sleep 1
|
||||
killall -q -KILL zerotier-one
|
||||
if [ -f /var/lib/zerotier-one/zerotier-one.pid ]; then
|
||||
kill -TERM `cat /var/lib/zerotier-one/zerotier-one.pid`
|
||||
sleep 1
|
||||
fi
|
||||
if [ -f /var/lib/zerotier-one/zerotier-one.pid ]; then
|
||||
kill -KILL `cat /var/lib/zerotier-one/zerotier-one.pid`
|
||||
fi
|
||||
|
||||
if [ -f /etc/init.d/zerotier-one ]; then
|
||||
echo "Removing SysV init items..."
|
||||
|
@ -60,11 +59,11 @@ fi
|
|||
echo "Erasing binary and support files..."
|
||||
if [ -d /var/lib/zerotier-one ]; then
|
||||
cd /var/lib/zerotier-one
|
||||
rm -rf zerotier-one *.persist identity.public *.log *.pid *.sh updates.d networks.d iddb.d
|
||||
rm -rf zerotier-one *.persist identity.public *.log *.pid *.sh updates.d networks.d iddb.d root-topology
|
||||
fi
|
||||
|
||||
echo "Erasing anything installed into system bin directories..."
|
||||
rm -f /usr/local/bin/zerotier-cli /usr/bin/zerotier-cli
|
||||
rm -f /usr/local/bin/zerotier-cli /usr/bin/zerotier-cli /usr/local/bin/zerotier-idtool /usr/bin/zerotier-idtool
|
||||
|
||||
echo "Done."
|
||||
echo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue