home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / doc / ppp / examples / scripts / ipv6-down.sample < prev    next >
Encoding:
Text File  |  2004-04-12  |  609 b   |  32 lines

  1. #!/bin/sh
  2. #
  3. # This script is called with the following parameters:
  4. # interface tty speed local-address remote-address ipparam
  5. #
  6.  
  7.  
  8. # Kill the router advertisement daemon on this interface.
  9. # The killing procedure is copied from RedHat 6.0 initscripts.
  10.  
  11. DEVICE="$1"
  12.  
  13. PIDFILE="/var/run/radvd-$DEVICE.pid"
  14.  
  15. [ -f "$PIDFILE" ] || exit 0
  16.  
  17. PID="$(cat "$PIDFILE")"
  18. if [ "$PID" != "" ]; then
  19.     if ps h "$PID" >/dev/null 2>&1; then
  20.     kill -TERM "$PID"
  21.     usleep 10000
  22.     if ps h "$PID" >/dev/null 2>&1; then
  23.         sleep 1
  24.         if ps h "$PID" >/dev/null 2>&1; then
  25.         kill -KILL "$PID"
  26.         fi
  27.     fi
  28.     fi
  29. fi
  30.  
  31. rm -f "$PIDFILE"
  32.