Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- # Copyright (c) 1995-2004 SuSE Linux AG, Nuernberg, Germany.
- # All rights reserved.
- #
- # Author: ol@fson
- #
- # /etc/init/igmprtd
- #
- ### BEGIN INIT INFO
- # Provides: igmprtd
- # Short-Description: IGMP-Proxy
- ### END INIT INFO
- #
- #
- ####################################################################
- # Please set the following values to your needs
- # Interface over which ppp is established
- #INTERNET_IF=eth1.7
- # If given virtual MAC is set it will be used on the VLAN7 interface
- # Some users reported problems if VLAN7 and 8 are using the same MAC
- # Set to 00:00:00:00:00:00 if no change is required
- #VIRTUAL_MAC=00:00:00:00:00:00
- # Set the time in seconds the dhcpd needs to get an IP address
- # If time is too short IGMP proxy daemon fails to start
- #DHCPD_TIME=6
- ####################################################################
- # Path to IGMPProxy
- IGMPRTD_BIN=/sbin/igmpproxy
- IGMPRTD_LOG=/var/log/igmpproxy.log
- IGMPRTD_CONFIG=/etc/igmpproxy.conf
- DEBUG=-d
- # Path to DHCP-daemon
- #DHCPD_BIN=/sbin/dhcpcd
- test -x $IGMPRTD_BIN || exit 5
- test -x $DHCPD_BIN || exit 5
- . /etc/rc.status
- # Reset status of this service
- rc_reset
- case "$1" in
- start)
- echo -n " Starting IGMP Proxy: Starting daemon"
- startproc $IGMPRTD_BIN $IGMPRTD_CONFIG $DEBUG >>$IGMPRTD_LOG 2>&1
- rc_status -v
- ;;
- stop)
- echo -n " Shutting down IGMP Proxy: Stopping daemon "
- killproc -TERM $IGMPRTD_BIN
- rc_status -v
- rc_reset
- ;;
- try-restart|condrestart)
- ## Do a restart only if the service was active before.
- ## Note: try-restart is now part of LSB (as of 1.9).
- ## RH has a similar command named condrestart.
- if test "$1" = "condrestart"; then
- echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
- fi
- $0 status
- if test $? = 0; then
- $0 restart
- else
- rc_reset # Not running is not a failure.
- fi
- # Remember status and be quiet
- rc_status
- ;;
- restart | force-reload )
- ## Stop the service and regardless of whether it was
- ## running or not, start it again.
- $0 stop
- $0 start
- # Remember status and be quiet
- rc_status
- ;;
- reload)
- ## Like force-reload, but if daemon does not support
- ## signaling, do nothing (!)
- echo -n "Reload service IGMP Proxy "
- killproc -HUP ${IGMPRTD_BIN}
- rc_status -v
- ;;
- status)
- echo -n "Checking IGMP components "
- ## Check status with checkproc(8), if process is running
- ## checkproc will return with exit status 0.
- # Return value is slightly different for the status command:
- # 0 - service up and running
- # 1 - service dead, but /var/run/ pid file exists
- # 2 - service dead, but /var/lock/ lock file exists
- # 3 - service not running (unused)
- # 4 - service status unknown :-(
- # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
- # NOTE: checkproc returns LSB compliant status values.
- checkproc $IGMPRTD_BIN
- # NOTE: rc_status knows that we called this init script with
- # "status" option and adapts its messages accordingly.
- rc_status -v
- ;;
- probe)
- ## Optional: Probe for the necessity of a reload, print out the
- ## argument to this init script which is required for a reload.
- ## Note: probe is not (yet) part of LSB (as of 1.2)
- test $IGMPRTD_CONFIG -nt /var/run/igmprtd.pid && echo reload
- ;;
- *)
- echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
- exit 1
- ;;
- esac
- rc_exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement