Created
May 4, 2018 14:07
-
-
Save rbgarga/25a65d85fad7945d1ca4fef771fa3ebd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc | |
index 55dd3b0901..3a4e97ccd6 100644 | |
--- a/src/etc/inc/util.inc | |
+++ b/src/etc/inc/util.inc | |
@@ -2425,7 +2425,8 @@ function route_add_or_change($args) { | |
} | |
/* First, try to add it */ | |
- $_gb = exec(escapeshellcmd("/sbin/route add " . $args), $output, $rc); | |
+ $_gb = exec(escapeshellcmd("/sbin/route add " . $args . " 2>/dev/null"), | |
+ $output, $rc); | |
if (isset($config['system']['route-debug'])) { | |
$add_change = 'add'; | |
@@ -2435,8 +2436,8 @@ function route_add_or_change($args) { | |
if ($rc != 0) { | |
/* If it fails, try to change it */ | |
- $_gb = exec(escapeshellcmd("/sbin/route change " . $args), | |
- $output, $rc); | |
+ $_gb = exec(escapeshellcmd("/sbin/route change " . $args . | |
+ " 2>/dev/null"), $output, $rc); | |
if (isset($config['system']['route-debug'])) { | |
$add_change = 'change'; | |
@@ -2445,7 +2446,8 @@ function route_add_or_change($args) { | |
} | |
} | |
if (isset($config['system']['route-debug'])) { | |
- file_put_contents("/dev/console", "\n[".getmypid()."] ROUTE: {$add_change} {$args} result: {$rc}"); | |
+ file_put_contents("/dev/console", | |
+ "\n[".getmypid()."] ROUTE: {$add_change} {$args} result: {$rc}"); | |
} | |
return ($rc == 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment