Skip to content
Snippets Groups Projects
Commit 6c22e057 authored by Bob Lantz's avatar Bob Lantz
Browse files

Avoid false matches and detect multiple host processes

parent 7bc10ebc
No related branches found
No related tags found
No related merge requests found
......@@ -9,10 +9,16 @@ else
host=$1
fi
pid=`pgrep -f mininet:$host`
pid=`ps ax | grep mininet:$host | grep bash | awk '{print $1};'`
if echo $pid | grep -q ' '; then
echo "Error: found multiple mininet:$host processes"
exit 2
fi
if [ "$pid" == "" ]; then
echo "Could not find Mininet host $host"
exit 2
exit 3
fi
if [ -z $2 ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment