diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-10-13 08:15:00 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-10-13 08:15:00 -0700 |
commit | 7943414c89c627a91a45e58d309d03b91ab75f87 (patch) | |
tree | b25039f530810b0953c800cfbbe0a7ea9b76c2cf /ext/installfiles | |
parent | c7c545bf6c4e99029925493c806e8fb230a105f3 (diff) | |
download | infinitytier-7943414c89c627a91a45e58d309d03b91ab75f87.tar.gz infinitytier-7943414c89c627a91a45e58d309d03b91ab75f87.zip |
Part two of fix to GitHub issue #118 -- need to test thoroughly though.
Diffstat (limited to 'ext/installfiles')
-rwxr-xr-x | ext/installfiles/linux/init.d/zerotier-one | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/ext/installfiles/linux/init.d/zerotier-one b/ext/installfiles/linux/init.d/zerotier-one index e253a864..fae3b1aa 100755 --- a/ext/installfiles/linux/init.d/zerotier-one +++ b/ext/installfiles/linux/init.d/zerotier-one @@ -65,6 +65,17 @@ case "$1" in if [ $running -gt 0 ]; then echo "Stopping ZeroTier One..." kill -TERM $pid + sleep 0.25 + if [ -f "$zthome/zerotier-one.pid" ]; then + sleep 0.5 + fi + if [ -f "$zthome/zerotier-one.pid" ]; then + sleep 1 + fi + if [ -f "$zthome/zerotier-one.pid" ]; then + kill -KILL $pid >>/dev/null 2>&1 + rm -f "$zthome/zerotier-one.pid" + fi else echo "ZeroTier One is not running." fi @@ -72,9 +83,19 @@ case "$1" in restart|reload|force-reload|condrestart|try-restart) echo "Restarting ZeroTier One..." if [ $running -gt 0 ]; then - kill -TERM $pid + kill -TERM $pid >>/dev/null 2>&1 + fi + sleep 0.25 + if [ -f "$zthome/zerotier-one.pid" ]; then + sleep 0.5 + fi + if [ -f "$zthome/zerotier-one.pid" ]; then + sleep 1 + fi + if [ -f "$zthome/zerotier-one.pid" ]; then + kill -KILL $pid >>/dev/null 2>&1 + rm -f "$zthome/zerotier-one.pid" fi - while [ -f "$zthome/zerotier-one.pid" ]; do sleep 1; done zerotier-one -d ;; status) |