ifup eth0 ERROR /sbin/ifup: line 268: [: : integer expression expected

来源:互联网 发布:数据库系统全书第二版 编辑:程序博客网 时间:2024/04/29 11:02

From:http://h30499.www3.hp.com/t5/Networking/sbin-ifup-line-268-integer-expression-expected/m-p/3545538#M4181

vi /sbin/ifup


找到下面部分:

# 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

将其该为:
NUMDEFROUTES=`ip -o route | \
grep "^default" | \
awk 'BEGIN { nlines = 0 } { nlines++ } END { print nlines }'`

这就使得NUMDEFROUTES有了一个interger 值


0 0
原创粉丝点击