2 [ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
4 set_classless_routes
() {
7 while [ -n "$1" -a -n "$2" -a $max -gt 0 ]; do
8 [ ${1##*/} -eq 32 ] && type=host ||
type=net
9 echo "udhcpc: adding route for $type $1 via $2"
10 route add
-$type "$1" gw
"$2" dev
"$interface"
17 echo "udhcpc: ifconfig $interface $ip netmask ${subnet:-255.255.255.0} broadcast ${broadcast:-+}"
18 ifconfig
$interface $ip netmask
${subnet:-255.255.255.0} broadcast
${broadcast:-+}
20 [ -n "$router" ] && [ "$router" != "0.0.0.0" ] && [ "$router" != "255.255.255.255" ] && {
21 echo "udhcpc: setting default routers: $router"
25 route add default gw
$i dev
$interface
26 valid_gw
="${valid_gw:+$valid_gw|}$i"
29 eval $
(route
-n |
awk '
30 /^0.0.0.0\W{9}('$valid_gw')\W/ {next}
31 /^0.0.0.0/ {print "route del -net "$1" gw "$2";"}
35 # CIDR STATIC ROUTES (rfc3442)
36 [ -n "$staticroutes" ] && set_classless_routes
$staticroutes
37 [ -n "$msstaticroutes" ] && set_classless_routes
$msstaticroutes
44 ifconfig
"$interface" 0.0.0.0
47 setup_interface update
55 [ -f /etc
/udhcpc.user
] && .
/etc
/udhcpc.user
This page took 0.055244 seconds and 5 git commands to generate.