#!/bin/sh
-
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
-[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
-
RESOLV_CONF="/etc/resolv.conf"
+
+[ -n "$1" ] || echo "Error: should be called from udhcpc" && exit 1
+
NETMASK=""
[ -n "$subnet" ] && NETMASK="netmask $subnet"
BROADCAST="broadcast +"
echo "Recreating $RESOLV_CONF"
echo -n > $RESOLV_CONF-$$
- [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF-$$
+ [ -n "$domain" ] && echo "search $domain" >> $RESOLV_CONF-$$
for i in $dns ; do
echo " Adding DNS server $i"
- echo nameserver $i >> $RESOLV_CONF-$$
+ echo "nameserver $i" >> $RESOLV_CONF-$$
done
mv $RESOLV_CONF-$$ $RESOLV_CONF
;;