Commit 300fc152 authored by Rohit Gupta's avatar Rohit Gupta

kill programs only if they exist to avoid kill signal to main python script

parent 4b6f4573
......@@ -13,7 +13,11 @@ pid="$$"
echo "pid = $pid"
echo "Killing programs now..."
ps -aux |grep -E -i $1 |awk '{print $2}'| tr '\n' ' ' | sed "s/$pid/ /" | sudo xargs kill -9
var=`ps -aux |grep -E -i $1 |awk '{print $2}'| tr '\n' ' ' | sed "s/$pid/ /"`
echo $var
if [ -n "$var" ] ; then sudo kill -9 $var ; fi
#| sudo xargs kill -9
echo "checking for old programs..."
var=`ps -aux |grep -E -i '$1' |grep -Ev 'grep' | grep -Ev '$filename'`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment