aboutsummaryrefslogtreecommitdiffstats
path: root/dhcpcd-hooks/50-dhcpcd-compat
blob: cba40a49a8d3138c07427296bbd65a8a1ca531a9 (plain)
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
# Compat enter hook shim for older dhcpcd versions

IPADDR=${new_ip_address}
INTERFACE=${interface}
NETMASK=${new_subnet_mask}
BROADCAST=${new_broadcast_address}
NETWORK=${new_network_number}
DHCPSID=${new_dhcp_server_identifier}
GATEWAYS=${new_routers}
DNSSERVERS=${new_domain_name_servers}
DNSDOMAIN=${new_domain_name}
DNSSEARCH=${new_domain_search}
NISDOMAIN=${new_nis_domain}
NISSERVERS=${new_nis_servers}
NTPSERVERS=${new_ntp_servers}

GATEWAY=
for x in ${new_routers}; do
	GATEWAY="${GATEWAY}${GATEWAY:+,}${x}"
done
DNS=
for x in ${new_domain_name_servers}; do
	DNS="${DNS}${DNS:+,}${x}"
done

x="down"
case "${reason}" in
RENEW) x="up";;
BOUND|INFORM|REBIND|REBOOT|TEST|TIMEOUT|IPV4LL) x="new";;
esac
set -- "" "${x}"