1 # Compat enter hook shim for older dhcpcd versions 2 3 IPADDR=$new_ip_address 4 INTERFACE=$interface 5 NETMASK=$new_subnet_mask 6 BROADCAST=$new_broadcast_address 7 NETWORK=$new_network_number 8 DHCPSID=$new_dhcp_server_identifier 9 GATEWAYS=$new_routers 10 DNSSERVERS=$new_domain_name_servers 11 DNSDOMAIN=$new_domain_name 12 DNSSEARCH=$new_domain_search 13 NISDOMAIN=$new_nis_domain 14 NISSERVERS=$new_nis_servers 15 NTPSERVERS=$new_ntp_servers 16 17 GATEWAY= 18 for x in $new_routers; do 19 GATEWAY="$GATEWAY${GATEWAY:+,}$x" 20 done 21 DNS= 22 for x in $new_domain_name_servers; do 23 DNS="$DNS${DNS:+,}$x" 24 done 25 26 x="down" 27 case "$reason" in 28 RENEW) x="up";; 29 BOUND|INFORM|REBIND|REBOOT|TEST|TIMEOUT|IPV4LL) x="new";; 30 esac 31 32 if [ "$reason" != "down" ]; then 33 rm -f /var/lib/dhcpcd-"$INTERFACE".info 34 for x in IPADDR INTERFACE NETMASK BROADCAST NETWORK DHCPSID GATEWAYS \ 35 DNSSERVERS DNSDOMAIN DNSSEARCH NISDOMAIN NISSERVERS \ 36 NTPSERVERS GATEWAY DNS; do 37 eval echo "$x=\'\$$x\'" >> /var/lib/dhcpcd-"$INTERFACE".info 38 done 39 fi 40 41 set -- /var/lib/dhcpcd-"$INTERFACE".info "$x" 42