register.sh 612 Bytes
Newer Older
1 2 3
#!/bin/sh
#
# EMULAB-COPYRIGHT
4
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
5 6 7 8 9 10
# All rights reserved.
#

#
# This file goes in /usr/local/etc/rc.d on the CDROM.
#
11
# Get the disk and pass that to the registration program. It does
12 13 14 15 16
# all the actual work.
# 

. /etc/rc.conf.local

17 18 19 20 21
if [ "$netbed_IP" = "DHCP" ]; then
	# See /etc/dhclient-exit-hooks
	netbed_IP=`cat /var/run/myip`    
fi

22 23 24
case "$1" in
start)
	if [ -f /usr/site/sbin/register.pl ]; then
25
		/usr/site/sbin/register.pl $netbed_disk $netbed_IP
26 27 28
		exit $?
	fi
	;;
Mike Hibler's avatar
Mike Hibler committed
29 30
stop)
	;;
31
*)
Mike Hibler's avatar
Mike Hibler committed
32
	echo "Usage: `basename $0` {start|stop}" >&2
33 34 35
	exit 1
	;;
esac