Description of problem: When there is no default route as reported by ip, the following error message appears in the log files: Aug 12 08:08:10 vh216203 ifup: ./ifup: line 268: [: : integer expression expected Version-Release number of selected component (if applicable): initscripts-7.14-1 How reproducible: Have no default route and give the command: service network restart Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: The problem is that the awk command on line 267 produces no output if there is no default route, because nlines is not initialized. The following diff shows a script that I think gives the results you desire: $ diff /sbin/ifup /tmp/ifup-fixed 267,268c267,268 < awk '{ nlines++ } END { print nlines }'` < if [ -n "$NUMDEFROUTES" -a "$NUMDEFROUTES" -gt 1 ]; then --- > awk 'BEGIN { nlines = 0 } { nlines++ } END { print nlines }'` > if [ "$NUMDEFROUTES" -gt 1 ]; then This change guarantees that $NUMDEFROUTES will have a numeric non-negative format.
Already fixed in 7.29-1.
Fix should get lost. In initscripts 7.42-1 (Fedora core 1), corresponded strings reads as (/sbin/ifup:307): NUMDEFROUTES=`ip -o route | \ awk '/^default/ { nlines++ } END { print nlines }'` so "BEGIN { nlines=0 }" missed. I have no power to reopen this bug, but logically, it should be reopened.
It's fixed differently, the if [...] clause was changed.