summaryrefslogtreecommitdiff
path: root/packages/openprotium-init/files/boot/udhcpc.script
diff options
context:
space:
mode:
Diffstat (limited to 'packages/openprotium-init/files/boot/udhcpc.script')
-rw-r--r--packages/openprotium-init/files/boot/udhcpc.script17
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/openprotium-init/files/boot/udhcpc.script b/packages/openprotium-init/files/boot/udhcpc.script
new file mode 100644
index 0000000000..3f437e3143
--- /dev/null
+++ b/packages/openprotium-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