ip-down 931 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. # this is a script which is executed after disconnecting the ppp interface.
  3. # look at man pppd for details
  4. # the followings parameters are available:
  5. # $1 = interface-name
  6. # $2 = tty-device
  7. # $3 = speed
  8. # $4 = local-IP-address
  9. # $5 = remote-IP-address
  10. # $6 = ipparam
  11. if [ "$USEPEERDNS" ]; then
  12. # taken from debian's 0000usepeerdns
  13. # follow any symlink to find the real file
  14. REALRESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
  15. if [ "$REALRESOLVCONF" != "/etc/ppp/resolv.conf" ]; then
  16. # if an old resolv.conf file exists, restore it
  17. if [ -e $REALRESOLVCONF.pppd-backup ]; then
  18. mv $REALRESOLVCONF.pppd-backup $REALRESOLVCONF
  19. fi
  20. fi
  21. fi
  22. # Recreate the default route so autodial works
  23. [ -s /etc/conf.d/net ] && . /etc/conf.d/net
  24. if [ -n "${gateway}" ] && [ "${gateway%/*}" = "$1" ]; then
  25. /sbin/route add default dev ${gateway%/*}
  26. fi
  27. [ -f /etc/ppp/ip-down.local ] && . /etc/ppp/ip-down.local "$@"