diff options
-rwxr-xr-x | network-scripts/ifup-routes | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/network-scripts/ifup-routes b/network-scripts/ifup-routes index 5cc9187b..4a90ad07 100755 --- a/network-scripts/ifup-routes +++ b/network-scripts/ifup-routes @@ -41,10 +41,12 @@ handle_ip_file() { fi { cat "$file" ; echo ; } | while read line; do if [[ ! "$line" =~ $MATCH ]]; then - /sbin/ip $proto "$type" add "$line" || { - net_log $"Failed to add ${type} ${line}, using ip ${type} replace instead." warning - /sbin/ip $proto "$type" replace "$line" - } + /sbin/ip $proto "$type" add "$line" + + if [ $? != 0 ] && [ "$type" == "route" ] ; then + net_log $"Failed to add route ${line}, using ip route replace instead." warning + /sbin/ip $proto route replace "$line" + fi fi done } |