stop-run 706 Bytes
Newer Older
1
#!/bin/sh
Mike Hibler's avatar
Mike Hibler committed
2 3 4 5 6
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

waitfor="-w"
agent=""

usage()
{
    echo "Usage: stop-run [-nfp] pid eid"
    echo "       -n do not wait for completion"
    echo "       -f run on fake plab nodes"
    echo "       -p run on real plab nodes (default)"
    exit 1
}

args=`getopt fnp $*`
if [ $? -ne 0 ]; then
    usage
fi
set -- $args
for i; do
    case "$i"
    in
        -n)
	    waitfor=
	    shift;;
	-f)
	    agent="_fake"
	    shift;;
	-p)
	    agent=""
	    shift;;
	--)
	    shift
	    break;;
    esac
done

if [ $# -lt 2 ]; then
    usage
fi

P=$1
E=$2

exec tevc $waitfor -e $P/$E now stop$agent run
exit $?