Skip to content

Commit

Permalink
Replace some backticks by exec ans simplify commands
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgarga committed Jun 19, 2014
1 parent 692c21f commit 96fcaba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion etc/inc/filter.inc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function flowtable_configure() {
else
$maxstates = 150000;
// nmbflows cpu count * ($maxstates * 2)
$cpus = trim(`/sbin/sysctl -n kern.smp.cpus`, " \n");
$cpus = trim(exec('/sbin/sysctl -n kern.smp.cpus'), " \n");
$nmbflows = ($cpus*($maxstates*2));
// Flowtable currently only works on 8.0
if(get_freebsd_version() == "8") {
Expand Down
2 changes: 1 addition & 1 deletion etc/inc/gwlb.inc
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ function fixup_default_gateway($ipprotocol, $gateways_status, $gateways_arr) {
mwexec("/sbin/route change {$inetfamily} default {$gateways_arr[$upgw]['gateway']}");
}
} else {
$defaultgw = trim(`/sbin/route -n get -{$ipprotocol} default | /usr/bin/grep gateway | /usr/bin/sed 's/gateway://g'`, " \n");
$defaultgw = trim(exec("/sbin/route -n get -{$ipprotocol} default | /usr/bin/awk '/gateway:/ {print $2}'"), " \n");
if(is_ipaddrv6($gateways_arr[$dfltgwname]['gateway'])) {
$inetfamily = "-inet6";
} else {
Expand Down

0 comments on commit 96fcaba

Please sign in to comment.