summaryrefslogtreecommitdiff
path: root/recipes/slugos-init/files/boot/udhcpc.script
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/slugos-init/files/boot/udhcpc.script')
-rw-r--r--recipes/slugos-init/files/boot/udhcpc.script17
1 files changed, 17 insertions, 0 deletions
diff --git a/recipes/slugos-init/files/boot/udhcpc.script b/recipes/slugos-init/files/boot/udhcpc.script
new file mode 100644
index 0000000000..3f437e3143
--- /dev/null
+++ b/recipes/slugos-init/files/boot/udhcpc.script
@@ -0,0 +1,17 @@
+#!/bin/sh
+# executed by udhcpc to do the real work of configuring an interface
+# writes the result (if any) to file descriptor 9
+case "$1" in
+deconfig) # ignored
+ :;;
+renew|bound) # this gives the real information
+ test -n "$ip" && {
+ echo "ip='$ip'"
+ echo "subnet='$subnet'"
+ echo "broadcast='$broadcast'"
+ echo "router='$router'"
+ } >&9;;
+leasefail) # ignore - probably no dhcp server
+ :;;
+*) echo "udhcpc: $*: command not recognised" >&2;;
+esac