ipv6-down.sample 609 B

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