Commit 834ccbe0 authored by Ad Schellevis's avatar Ad Schellevis

fixup_default_gateway suppress stderr

parent 6009ab93
...@@ -755,7 +755,7 @@ function fixup_default_gateway($gateways_status, $gateways_arr) ...@@ -755,7 +755,7 @@ function fixup_default_gateway($gateways_status, $gateways_arr)
} else { } else {
$gwip = $gateways_arr[$dfltgwname]['gateway']; $gwip = $gateways_arr[$dfltgwname]['gateway'];
} }
$tmpcmd = "/sbin/route -n get -{$ipprotocol} default | /usr/bin/awk '/gateway:/ {print $2}'"; $tmpcmd = "sh -c '/sbin/route -n get -{$ipprotocol} default 2>/dev/null' | /usr/bin/awk '/gateway:/ {print $2}'";
$defaultgw = trim(exec($tmpcmd), " \n"); $defaultgw = trim(exec($tmpcmd), " \n");
if (!$dfltgwup) { if (!$dfltgwup) {
log_error("Default gateway down setting {$dfltgwname} as default!"); log_error("Default gateway down setting {$dfltgwname} as default!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment