vmc-client.initd 1.51 KB
Newer Older
Russ Fish's avatar
Russ Fish committed
1 2
#! /bin/sh

David Johnson's avatar
David Johnson committed
3 4
#
# Copyright (c) 2005-2006 University of Utah and the Flux Group.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
David Johnson's avatar
David Johnson committed
24 25
#

Russ Fish's avatar
Russ Fish committed
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 52 53 54 55 56 57 58 59 60 61 62
# chkconfig: 2345 30 90
# description: Vision master control client software.

# Source function library.
. /etc/rc.d/init.d/functions

PORTBASE=6100
CAMERAS="0 1 2 3"

case "$1" in
start)
	for cam in $CAMERAS; do
		/usr/testbed/sbin/vmc-client -d -p $PORTBASE \
			`cat /etc/vmc-client/client.$cam` \
			/tmp/mezz_instance/dev/video${cam}.ipc \
			> /var/log/vmc-client.$cam.log 2>&1 &
		echo $! > /var/run/vmc-client.$cam.pid
		PORTBASE=`expr $PORTBASE + 1`
	done
        ;;
stop)
	for cam in $CAMERAS; do
		kill `cat /var/run/vmc-client.$cam.pid`
		rm /var/run/vmc-client.$cam.pid
	done
        ;;
restart)
	$0 stop
	$0 start
	;;
*)
        echo "Usage: `basename $0` {start|stop|restart}" >&2
        ;;
esac

exit 0