Installer/Updater
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1015 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #!/bin/sh
  2. set -e
  3. # Description: Remove routes to allow communication between machines which
  4. # only have an IPv4LL address assigned and those which only
  5. # have a routable address assigned. These were added by
  6. # /etc/network/if-up.d/avahi-autoipd.
  7. #
  8. # See http://developer.apple.com/qa/qa2004/qa1357.html for
  9. # more information.
  10. [ -x /usr/sbin/avahi-autoipd ] || exit 0
  11. [ "$IFACE" != "lo" ] || exit 0
  12. case "$ADDRFAM" in
  13. inet) ;;
  14. *) exit 0 ;;
  15. esac
  16. case "$METHOD" in
  17. static|dhcp|NetworkManager) ;;
  18. *) exit 0 ;;
  19. esac
  20. if [ -x /bin/ip ]; then
  21. # route already present?
  22. ip route show | grep -q '^169.254.0.0/16[[:space:]]' && exit 0
  23. /bin/ip route del 169.254.0.0/16 dev $IFACE metric 1000 scope link || true
  24. elif [ -x /sbin/route ]; then
  25. # route already present?
  26. /sbin/route -n | grep -q "^169.254.0.0[[:space:]]" && exit 0
  27. /sbin/route del -net 169.254.0.0 netmask 255.255.0.0 dev $IFACE metric 1000 || true
  28. fi