If it's up to date, it'll be something like this:
# DHCP likes to create duplicate routes. Fix that up.
NUMDEFROUTES=`ip -o route | \
grep "^default" | \
awk '{ nlines++ } END { print nlines }'`
if [ -n "$NUMDEFROUTES" -a "$NUMDEFROUTES" -gt 1 ]; then
# remove the default route for the new device (old route wins)
ip route del default dev ${DEVICE}
fi
# end dynamic device configuration
Which would mean that therere absolutely *NO* default routes, the '"$NUMDEFROUTES" -gt 1' section failed.
Why aren't there any default routes?
In any case, the fix is to alter the NUMDEFROUTES= line to:
NUMDEFROUTES=`ip -o route | \
grep "^default" | \
awk 'BEGIN { nlines = 0 } { nlines++ } END { print nlines }'`
This forces NUMDEFROUTES to have an interger value, regardless of whether there is or is not any default routes.
One long-haired git at your service...