mirror of
https://github.com/sheumann/hush.git
synced 2025-01-18 07:31:34 +00:00
tweak example udhcp script
This commit is contained in:
parent
ad4bd0548a
commit
1b47bbdfa4
@ -1,10 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
|
# 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"
|
RESOLV_CONF="/etc/resolv.conf"
|
||||||
|
|
||||||
|
[ -n "$1" ] || echo "Error: should be called from udhcpc" && exit 1
|
||||||
|
|
||||||
NETMASK=""
|
NETMASK=""
|
||||||
[ -n "$subnet" ] && NETMASK="netmask $subnet"
|
[ -n "$subnet" ] && NETMASK="netmask $subnet"
|
||||||
BROADCAST="broadcast +"
|
BROADCAST="broadcast +"
|
||||||
@ -35,10 +35,10 @@ case "$1" in
|
|||||||
|
|
||||||
echo "Recreating $RESOLV_CONF"
|
echo "Recreating $RESOLV_CONF"
|
||||||
echo -n > $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
|
for i in $dns ; do
|
||||||
echo " Adding DNS server $i"
|
echo " Adding DNS server $i"
|
||||||
echo nameserver $i >> $RESOLV_CONF-$$
|
echo "nameserver $i" >> $RESOLV_CONF-$$
|
||||||
done
|
done
|
||||||
mv $RESOLV_CONF-$$ $RESOLV_CONF
|
mv $RESOLV_CONF-$$ $RESOLV_CONF
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user