Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbgarga/25a65d85fad7945d1ca4fef771fa3ebd to your computer and use it in GitHub Desktop.
Save rbgarga/25a65d85fad7945d1ca4fef771fa3ebd to your computer and use it in GitHub Desktop.
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