File: avahi-autoipd.if-up

package info (click to toggle)
avahi 0.6.32-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,888 kB
  • sloc: ansic: 39,999; sh: 6,219; xml: 4,433; cs: 2,185; makefile: 1,705; python: 310; cpp: 222
file content (37 lines) | stat: -rwxr-xr-x 923 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

set -e

# Description:      Add routes to allow communication between machines which
#                   only have an IPv4LL address assigned and those which only
#                   have a routable address assigned.
#
#                   See http://developer.apple.com/qa/qa2004/qa1357.html for
#                   more information.

[ -x /usr/sbin/avahi-autoipd ] || exit 0

[ "$IFACE" != "lo" ] || exit 0
case "$ADDRFAM" in
	inet) ;;
	*) exit 0 ;;
esac

case "$METHOD" in
	static|dhcp|NetworkManager) ;;
	*) exit 0 ;;
esac


if [ -x /bin/ip ]; then
	# route already present?
	ip route show | grep -q '^169.254.0.0/16[[:space:]]' && exit 0

	/bin/ip route add 169.254.0.0/16 dev $IFACE metric 1000 scope link
elif [ -x /sbin/route ]; then
	# route already present?
	/sbin/route -n | egrep -q "^169.254.0.0[[:space:]]" && exit 0

	/sbin/route add -net 169.254.0.0 netmask 255.255.0.0 dev $IFACE metric 1000
fi