From 2c0e7fd7fb050f3e3c2271a3570d2f0139c23933 Mon Sep 17 00:00:00 2001 From: Michael <30936296+mtan93@users.noreply.github.com> Date: Tue, 20 Sep 2022 18:29:35 +0100 Subject: [PATCH] Update zerotier.sh --- zerotier.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zerotier.sh b/zerotier.sh index 54cf5f8..c792213 100755 --- a/zerotier.sh +++ b/zerotier.sh @@ -55,6 +55,16 @@ sleep 1 echo "Command: DeterminateManualStep: 1" >> $deplog +# Kill off the ZeroTier.app and then ZeroTier auth copy processes as the mdm root user manages network join +echo "Status: Killing Processes" >> ${logfile} +echo "Status: Killing Processes" >> ${deplog} +app-pid=$(ps aux | grep 'ZeroTier' | grep -v 'grep' | grep -v 'security' | awk '{print$2}') +auth-pid=$(ps aux | grep 'ZeroTier' | grep 'security' | grep -v 'grep' | awk '{print$2}'); +kill -9 $app-pid +kill -9 $auth-pid +#This sleep is functional and is needed to allow the processes to close properly before reopening the application +sleep 5 + # echo "Status: Joining ZeroTier to network ${@}" >> ${logfile} # echo "Status: Joining ZeroTier to network ${@}" >> ${deplog} # /usr/local/bin/zerotier-cli join $@