Rev 8 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/sh#### BEGIN INIT INFO# Provides: dhcrelay# Default-Start:# Default-Stop:# Should-Start:# Required-Start: $network# Required-Stop:# Short-Description: Start and stop the DHCP relay server for IPv6# Description: dhcrelay provides the Dynamic Host Configuration Protocol (DHCP)# relay server. This is required when your DHCP server is on# another network segment from the clients.### END INIT INFO## The fields below are left around for legacy tools (will remove later).## chkconfig: - 65 35# description: dhcrelay provides a relay for Dynamic Host Control Protocol.# processname: dhcrelay# # pidfile: /var/run/dhcrelay6.pid. /etc/rc.d/init.d/functionsRETVAL=0prog=dhcrelayexec=/usr/sbin/dhcrelaylockfile=/var/lock/subsys/dhcrelay6pidfile=/var/run/dhcrelay6.pidconfig=/etc/sysconfig/dhcrelay6# The dhcrelay daemon uses the sysconfig file for configuration information.# There is no native configuration file for this program and you must specify# its settings on the command line.[ -f $config ] && . $configconfigtest() {[ -x $exec ] || exit 5[ -f $config ] || exit 6[ -z "$UPPER_INTERFACES" ] && exit 6[ -z "$LOWER_INTERFACES" ] && exit 6return 0}rh_status() {status -p $pidfile -l $(basename $lockfile) $exec}rh_status_q() {rh_status >/dev/null 2>&1}start() {[ `id -u` -eq 0 ] || exit 4[ -x $exec ] || exit 5[ -f $config ] || exit 6rh_status_q && return 0echo -n $"Starting $prog (DHCPv6): "daemon --pidfile=$pidfile $exec -6 $DHCRELAYARGS $(for int in $LOWER_INTERFACES ; do echo -n " -l $int" ; done) \$(for int in $UPPER_INTERFACES ; do echo -n " -u $int" ; done) 2>/dev/nullRETVAL=$?echo[ $RETVAL -eq 0 ] && touch $lockfilereturn $RETVAL}stop() {[ `id -u` -eq 0 ] || exit 4rh_status_q || return 0echo -n $"Shutting down $prog (DHCPv6): "killproc -p $pidfile $progRETVAL=$?echo[ $RETVAL -eq 0 ] && rm -f $lockfilereturn $RETVAL}usage() {echo $"Usage: $0 {start|stop|restart|force-reload|condrestart|try-restart|configtest|status}"}if [ $# -gt 1 ]; thenexit 2ficase "$1" instart)start;;stop)stop;;restart|force-reload)stop ; start;;condrestart|try-restart)rh_status_q || exit 0stop ; start;;reload)usage# unimplemented featureexit 3;;configtest)configtest;;status)rh_status;;*)usageexit 2;;esacexit $?