summaryrefslogtreecommitdiffstats
path: root/package/busybox/udhcpc.script
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2014-06-17 13:21:47 +0800
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-01-02 19:24:57 +0100
commit8fb574fdc88e6b83f7a51d215602c9dbf08a30a3 (patch)
treef9a65ffa736fb1f9380a62407c8dd59bc0dd3666 /package/busybox/udhcpc.script
parent952391db0477d1baa9c451fe0b3dabbfaef5a9b7 (diff)
downloadbuildroot-8fb574fdc88e6b83f7a51d215602c9dbf08a30a3.tar.gz
buildroot-8fb574fdc88e6b83f7a51d215602c9dbf08a30a3.zip
package/busybox: Add facility for DHCP hooks
The (u)dhcpc hook installed by the busybox package configures the network and exits. If we want to do anything further with a DHCP lease, we'd have to replace the script entirely. This change introduces a .d directory for hooks (based on the script filename), which are executed after the interface configuration. This allows packages to drop a script file in the .d directory to perform actions on DHCP events. We'll use this in a later change to notify petitboot of DHCP boot information. [Thomas: update to latest Buildroot, fix indentation.] Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/busybox/udhcpc.script')
-rwxr-xr-xpackage/busybox/udhcpc.script6
1 files changed, 6 insertions, 0 deletions
diff --git a/package/busybox/udhcpc.script b/package/busybox/udhcpc.script
index e23d1f1e0f..50c52e6fe3 100755
--- a/package/busybox/udhcpc.script
+++ b/package/busybox/udhcpc.script
@@ -64,4 +64,10 @@ case "$1" in
;;
esac
+HOOK_DIR="$0.d"
+for hook in "${HOOK_DIR}/"*; do
+ [ -f "${hook}" -a -x "${hook}" ] || continue
+ "${hook}" "${@}"
+done
+
exit 0
OpenPOWER on IntegriCloud