Created
March 26, 2016 05:20
-
-
Save mehmetg/9cdc77269ddef72ebc84 to your computer and use it in GitHub Desktop.
Stops SC and relies on the pid files created by https://gist.github.com/mehmetg/20c2a0f9df25424e130a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cat /tmp/sc*.pid | |
pids=$(cat /tmp/sc*.pid) | |
if ! [[ -z $pids ]]; then | |
echo $pids | xargs kill | |
fi | |
ctr=0 | |
while ! [[ -z $(ls /tmp/sc*.pid |grep pid) ]] && [[ ctr -lt 100 ]]; | |
do | |
echo "Waiting for tunnel shutdown ${ctr}" | |
let ctr=ctr+1 | |
sleep 3 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment