Skip to content
Snippets Groups Projects
Commit 300fc152 authored by Rohit Gupta's avatar Rohit Gupta
Browse files

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

parent 4b6f4573
Branches
Tags
No related merge requests found
......@@ -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'`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment