Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.46 KB | None | 0 0
  1. #! /bin/sh
  2. # Copyright (c) 1995-2004 SuSE Linux AG, Nuernberg, Germany.
  3. # All rights reserved.
  4. #
  5. # Author: ol@fson
  6. #
  7. # /etc/init/igmprtd
  8. #
  9. ### BEGIN INIT INFO
  10. # Provides:          igmprtd
  11. # Short-Description: IGMP-Proxy
  12. ### END INIT INFO
  13. #
  14. #
  15.  
  16.  
  17. ####################################################################
  18. # Please set the following values to your needs
  19. # Interface over which ppp is established
  20.  
  21. #INTERNET_IF=eth1.7
  22.  
  23. # If given virtual MAC is set it will be used on the VLAN7 interface
  24. # Some users reported problems if VLAN7 and 8 are using the same MAC
  25. # Set to 00:00:00:00:00:00 if no change is required
  26.  
  27. #VIRTUAL_MAC=00:00:00:00:00:00
  28.  
  29. # Set the time in seconds the dhcpd needs to get an IP address
  30. # If time is too short IGMP proxy daemon fails to start
  31.  
  32. #DHCPD_TIME=6
  33.  
  34. ####################################################################
  35.  
  36.  
  37.  
  38. # Path to IGMPProxy
  39. IGMPRTD_BIN=/sbin/igmpproxy
  40. IGMPRTD_LOG=/var/log/igmpproxy.log
  41. IGMPRTD_CONFIG=/etc/igmpproxy.conf
  42. DEBUG=-d
  43.  
  44. # Path to DHCP-daemon
  45. #DHCPD_BIN=/sbin/dhcpcd
  46.  
  47.  
  48. test -x $IGMPRTD_BIN || exit 5
  49. test -x $DHCPD_BIN || exit 5
  50.  
  51. . /etc/rc.status
  52.  
  53. # Reset status of this service
  54. rc_reset
  55.  
  56.  
  57. case "$1" in
  58.     start)
  59.     echo -n "   Starting IGMP Proxy: Starting daemon"
  60.     startproc $IGMPRTD_BIN $IGMPRTD_CONFIG $DEBUG >>$IGMPRTD_LOG 2>&1
  61.  
  62.     rc_status -v
  63.     ;;
  64.    
  65.  
  66.     stop)
  67.  
  68.     echo -n "   Shutting down IGMP Proxy: Stopping daemon "
  69.    
  70.     killproc -TERM $IGMPRTD_BIN
  71.    
  72.     rc_status -v
  73.  
  74.     rc_reset
  75.     ;;
  76.    
  77.  
  78.     try-restart|condrestart)
  79.     ## Do a restart only if the service was active before.
  80.     ## Note: try-restart is now part of LSB (as of 1.9).
  81.     ## RH has a similar command named condrestart.
  82.     if test "$1" = "condrestart"; then
  83.         echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
  84.     fi
  85.     $0 status
  86.     if test $? = 0; then
  87.         $0 restart
  88.     else
  89.         rc_reset    # Not running is not a failure.
  90.     fi
  91.     # Remember status and be quiet
  92.     rc_status
  93.     ;;
  94.    
  95.     restart | force-reload )
  96.     ## Stop the service and regardless of whether it was
  97.     ## running or not, start it again.
  98.     $0 stop
  99.     $0 start
  100.  
  101.     # Remember status and be quiet
  102.     rc_status
  103.     ;;
  104.    
  105.     reload)
  106.     ## Like force-reload, but if daemon does not support
  107.     ## signaling, do nothing (!)
  108.     echo -n "Reload service IGMP Proxy "
  109.     killproc -HUP ${IGMPRTD_BIN}
  110.     rc_status -v
  111.     ;;
  112.    
  113.     status)
  114.     echo -n "Checking IGMP components "
  115.     ## Check status with checkproc(8), if process is running
  116.     ## checkproc will return with exit status 0.
  117.  
  118.     # Return value is slightly different for the status command:
  119.     # 0 - service up and running
  120.     # 1 - service dead, but /var/run/  pid  file exists
  121.     # 2 - service dead, but /var/lock/ lock file exists
  122.     # 3 - service not running (unused)
  123.     # 4 - service status unknown :-(
  124.     # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
  125.    
  126.     # NOTE: checkproc returns LSB compliant status values.
  127.     checkproc $IGMPRTD_BIN
  128.     # NOTE: rc_status knows that we called this init script with
  129.     # "status" option and adapts its messages accordingly.
  130.     rc_status -v
  131.     ;;
  132.    
  133.     probe)
  134.     ## Optional: Probe for the necessity of a reload, print out the
  135.     ## argument to this init script which is required for a reload.
  136.     ## Note: probe is not (yet) part of LSB (as of 1.2)
  137.  
  138.     test $IGMPRTD_CONFIG -nt /var/run/igmprtd.pid && echo reload
  139.     ;;
  140.     *)
  141.     echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
  142.     exit 1
  143.     ;;
  144. esac
  145. rc_exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement