summaryrefslogtreecommitdiffstats
path: root/src.usr/share/udhcpc/default.script
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-05-19 17:08:06 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-05-19 17:08:06 (EDT)
commit4c443fafc639c6c7ab6832edc4664a626f305001 (patch)
tree36526ae6d017e5e69fbe2e1700ec575aab9941e6 /src.usr/share/udhcpc/default.script
parent861c42862a895f0a45cb54546ff67f02091f1ed7 (diff)
/usr/share/udhcpc/default.script: New file.
Diffstat (limited to 'src.usr/share/udhcpc/default.script')
-rwxr-xr-xsrc.usr/share/udhcpc/default.script32
1 files changed, 32 insertions, 0 deletions
diff --git a/src.usr/share/udhcpc/default.script b/src.usr/share/udhcpc/default.script
new file mode 100755
index 0000000..2f65e45
--- /dev/null
+++ b/src.usr/share/udhcpc/default.script
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+case "${1}" in
+ 'deconfig')
+ /sbin/ifconfig "${interface}" 0.0.0.0
+ ;;
+ 'renew' | 'bound')
+ /sbin/ifconfig "${interface}" "${ip}" \
+ ${broadcast+broadcast ${broadcast}} \
+ ${netmask+netmask ${netmask}}
+ if [ "x${router+set}" = 'xset' ]; then
+ while /sbin/route del default gw 0.0.0.0 \
+ dev "${interface}" 2>/dev/null; do
+ :
+ done
+ for router in ${router}; do
+ /sbin/route add default gw "${router}" \
+ dev "${interface}"
+ done
+ fi
+ exec 3>'/etc/resolv.conf'
+ if [ "x${domain+set}" = 'xset' ]; then
+ printf 'search %s\n' "${domain}" >&3
+ fi
+ for dns in ${dns}; do
+ printf 'nameserver %s\n' "${dns}" >&3
+ done
+ exec 3>&-
+ ;;
+esac
+
+exit 0