diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-06-19 16:29:57 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-06-19 16:29:57 -0300 |
commit | 96fcabaae31466118a703c6a29939b9f50bc77f6 (patch) | |
tree | dbee968895ca1987449084066de57f06f67eb1c2 /etc | |
parent | 692c21fd3788af7a5c22cca2c271650b0a9f24e8 (diff) | |
download | pfsense-96fcabaae31466118a703c6a29939b9f50bc77f6.zip pfsense-96fcabaae31466118a703c6a29939b9f50bc77f6.tar.gz |
Replace some backticks by exec ans simplify commands
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/filter.inc | 2 | ||||
-rw-r--r-- | etc/inc/gwlb.inc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 6526d44..e0cff7e 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -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") { diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index e5c5058..6935e9a 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -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 { |