xcat-core/xCAT-nbroot/overlay/usr/share/udhcpc/default.script

26 lines
675 B
Plaintext
Raw Normal View History

#!/bin/sh
case $1 in
deconfig)
/sbin/ifconfig $interface up
/sbin/ifconfig $interface 0.0.0.0
;;
bound|renew)
echo $siaddr >> /tmp/dhcpserver
/sbin/ifconfig $interface $ip netmask $subnet
if [ -n "$router" ] ; then
while route del default gw 0.0.0.0 dev $interface > /dev/null 2>&1; do
:
done
for i in $router ; do
route add default gw $i dev $interface
done
fi
echo -n > /etc/resolv.conf
[ -n "$domain" ] && echo search $domain >> /etc/resolv.conf
for i in $dns ; do
echo nameserver $i >> /etc/resolv.conf
done
;;
esac