You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
577 B

#!/bin/sh
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
case "$1" in
deconfig)
ip link set $interface up
;;
renew|bound)
ip addr flush dev $interface
ip addr add $ip/$mask dev $interface
if [ -n "$router" ]; then
ip route flush match 0 dev $interface
for i in $router ; do
ip route add default via $i # dev $interface
done
fi
echo -n > $RESOLV_CONF
[ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
for i in $dns ; do
echo nameserver $i >> $RESOLV_CONF
done
;;
esac
exit 0