emulab.sh 839 Bytes
Newer Older
1 2 3 4 5 6 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
#!/bin/sh
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003, 2007 University of Utah and the Flux Group.
# All rights reserved.
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
[ -f /etc/default/rcS ] && . /etc/default/rcS
. /lib/lsb/init-functions

. /etc/emulab/paths.sh

case "$1" in
    start)
	if [ -x $BINDIR/emulabctl ]; then
	    log_daemon_msg "Starting Emulab services" ""
	    $BINDIR/emulabctl start
	    log_end_msg $?
	fi
        ;;
    reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
	if [ -x $BINDIR/emulabctl ]; then
	    log_daemon_msg "Stopping Emulab services" ""
	    $BINDIR/emulabctl stop
	    log_end_msg $?
	fi
        ;;
    restart)
	$0 stop && sleep 10 && $0 start
	;;
    *)
        echo "Usage: $0 start|stop|restart" >&2
        exit 3
        ;;
esac

exit 0