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
#!/bin/sh | |
pid=$(ps -fe | grep 'bird' | grep -v grep | awk '{print $2}') | |
if [[ -n $pid ]]; then | |
kill $pid | |
else | |
echo "bird is not running" | |
fi |
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
#!/bin/sh | |
bird_pid=$(pgrep bird) | |
cloudd_pid=$(pgrep cloudd) | |
nsurlsessiond=$(pgrep nsurlsessiond) | |
# check all the values are not empty | |
# refactor to not use [[ ]] and use [ ] instead | |
if [[ -z "$bird_pid" || -z "$cloudd_pid" || -z "$nsurlsessiond" ]]; then | |
echo "bird, cloudd or nsurlsessiond is not running" | |
exit 1 |