aboutsummaryrefslogtreecommitdiffstats
path: root/dhcpcd-hooks/95-configured
blob: ee33b493922dcaf5623c58407b0d16ecb5927927 (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
32
33
34
# This script runs last, after all network configuration
# has completed. It sets a property to let the framework
# know that setting up the interface is complete.

if [[ $interface == p2p* ]]
    then
    intf=p2p
    else
    intf=$interface
fi

# For debugging:
setprop dhcp.${intf}.reason "${reason}"

case "${reason}" in
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT)
    setprop dhcp.${intf}.ipaddress  "${new_ip_address}"
    setprop dhcp.${intf}.gateway    "${new_routers%% *}"
    setprop dhcp.${intf}.mask       "${new_subnet_mask}"
    setprop dhcp.${intf}.leasetime  "${new_dhcp_lease_time}"
    setprop dhcp.${intf}.server     "${new_dhcp_server_identifier}"
    setprop dhcp.${intf}.vendorInfo "${new_vendor_encapsulated_options}"

    setprop dhcp.${intf}.result "ok"
    ;;

EXPIRE|FAIL|IPV4LL|STOP)
    setprop dhcp.${intf}.result "failed"
    ;;

RELEASE)
    setprop dhcp.${intf}.result "released"
    ;;
esac