blob: da09235ef9e3fa5760589a9a2651e02f77d43876 (
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
35
36
37
38
39
40
41
42
43
|
#!/system/bin/sh
# dhcpcd client configuration script
# Handy variables and functions for our hooks to use
case "$reason" in
ROUTERADVERT)
ifsuffix=":ra";;
INFORM6|BOUND6|RENEW6|REBIND6|REBOOT6|EXPIRE6|RELEASE6|STOP6)
ifsuffix=":dhcp6";;
*)
ifsuffix=;;
esac
ifname="$interface$ifsuffix"
from=from
signature_base="# Generated by dhcpcd"
signature="${signature_base} ${from} ${interface}"
signature_base_end="# End of dhcpcd"
signature_end="${signature_base_end} ${from} ${interface}"
state_dir="/data/misc/dhcpcd"
: ${if_up:=false}
: ${if_down:=false}
# We source each script into this one so that scripts run earlier can
# remove variables from the environment so later scripts don't see them.
# Thus, the user can create their dhcpcd.enter/exit-hook script to configure
# /etc/resolv.conf how they want and stop the system scripts ever updating it.
for hook in \
/system/etc/dhcpcd/dhcpcd.enter-hook \
/system/etc/dhcpcd/dhcpcd-hooks/* \
/system/etc/dhcpcd/dhcpcd.exit-hook
do
for skip in ${skip_hooks}; do
case "${hook}" in
*/"${skip}") continue 2;;
*/[0-9][0-9]"-${skip}") continue 2;;
*/[0-9][0-9]"-${skip}.sh") continue 2;;
esac
done
if ls "${hook}" >/dev/null 2>&1; then
. "${hook}"
fi
done
|