add system files
[GitHub/Stricted/sm-g903f-system.git] / etc / dhcpcd / dhcpcd-run-hooks
1 #!/system/bin/sh
2 # dhcpcd client configuration script
3
4 # Handy variables and functions for our hooks to use
5 from="from"
6 signature_base="# Generated by dhcpcd"
7 signature="${signature_base} ${from} ${interface}"
8 signature_base_end="# End of dhcpcd"
9 signature_end="${signature_base_end} ${from} ${interface}"
10 state_dir="/data/misc/dhcpcd"
11
12 # We source each script into this one so that scripts run earlier can
13 # remove variables from the environment so later scripts don't see them.
14 # Thus, the user can create their dhcpcd.enter/exit-hook script to configure
15 # /etc/resolv.conf how they want and stop the system scripts ever updating it.
16 for hook in \
17 /system/etc/dhcpcd/dhcpcd.enter-hook \
18 /system/etc/dhcpcd/dhcpcd-hooks/* \
19 /system/etc/dhcpcd/dhcpcd.exit-hook
20 do
21 for skip in ${skip_hooks}; do
22 case "${hook}" in
23 */"${skip}") continue 2;;
24 */[0-9][0-9]"-${skip}") continue 2;;
25 */[0-9][0-9]"-${skip}.sh") continue 2;;
26 esac
27 done
28 if ls "${hook}" >/dev/null 2>&1; then
29 . "${hook}"
30 fi
31 done