"Fossies" - the Fresh Open Source Software Archive

Member "dhcpcd-9.4.1/hooks/50-dhcpcd-compat" (22 Oct 2021, 1014 Bytes) of package /linux/misc/dhcpcd-9.4.1.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    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 r="down"
   27 case "$reason" in
   28 RENEW) r="up";;
   29 BOUND|INFORM|REBIND|REBOOT|TEST|TIMEOUT|IPV4LL) r="new";;
   30 esac
   31 
   32 if [ "$r" != "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 "$r"