aboutsummaryrefslogtreecommitdiffstats
path: root/dhcpcd-run-hooks
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:04:11 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:04:11 -0800
commit4c5a5fb53bccceff331bae70f748bf9b4609fe0a (patch)
treed6ae69d0d3f4a4d760a3254ec326bca4a8afacfe /dhcpcd-run-hooks
parente95877ecfa1170d77b1ec1f66752725cdda01b64 (diff)
downloadexternal_dhcpcd-4c5a5fb53bccceff331bae70f748bf9b4609fe0a.zip
external_dhcpcd-4c5a5fb53bccceff331bae70f748bf9b4609fe0a.tar.gz
external_dhcpcd-4c5a5fb53bccceff331bae70f748bf9b4609fe0a.tar.bz2
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'dhcpcd-run-hooks')
-rwxr-xr-xdhcpcd-run-hooks29
1 files changed, 11 insertions, 18 deletions
diff --git a/dhcpcd-run-hooks b/dhcpcd-run-hooks
index 83534be..db9c4f8 100755
--- a/dhcpcd-run-hooks
+++ b/dhcpcd-run-hooks
@@ -1,29 +1,22 @@
#!/system/bin/sh
# dhcpcd client configuration script
-# Handy functions for our hooks to use
-signature="# Generated by dhcpcd for ${interface}"
-save_conf()
-{
- if ls "$1" >/dev/null 2>&1; then
- rm -f "$1"-pre."${interface}"
- mv -f "$1" "$1"-pre."${interface}"
- fi
-}
-restore_conf()
-{
- ls "$1"-pre."${interface}" >/dev/null 2>&1 || return 1
- rm -f "$1"
- mv -f "$1"-pre."${interface}" "$1"
-}
+# Handy variables and functions for our hooks to use
+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"
# 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.hook script to configure
+# 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.hook \
- /system/etc/dhcpcd/dhcpcd-hooks/*
+ /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