8 echo "Usage: $COMMAND -l"
9 echo " lists current qemu processes"
10 echo "usage: $COMMAND hostname"
11 echo " kill qemu instance for that node"
15 function list_pids () {
17 if [[ -n "$hostnames" ]] ; then
18 for hostname in $hostnames; do
19 nodedir=qemu-$hostname
20 cat $nodedir/qemu.pid $nodedir/shell.pid 2> /dev/null
27 function kill_from_file () {
29 if [ -f $file ] ; then
37 function kill_pids () {
39 if [[ -n "$hostnames" ]] ; then
40 for hostname in $hostnames; do
41 nodedir=qemu-$hostname
42 kill_from_file $nodedir/qemu.pid
43 kill_from_file $nodedir/shell.pid
46 echo Killing all processes mathing qemu
51 function show_pids () {
52 pids=$(list_pids "$@")
53 if [ -n "$pids" ] ; then
54 ps $pids | grep -v $COMMAND || echo Nothing to show
61 while getopts "lk" opt; do
71 if [ -n "$OPT_LIST" ] ; then