diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-06-19 15:58:06 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-06-19 15:58:06 -0300 |
commit | 3f0c20c3cd022925063d4c9b8d24a1f91fd8ca07 (patch) | |
tree | 7b76ae99f99a7840eed1642e825fe79fca1fbd85 | |
parent | c69d32f65d17ad7511afffa4fc581d7ebac87f80 (diff) | |
download | pfsense-3f0c20c3cd022925063d4c9b8d24a1f91fd8ca07.zip pfsense-3f0c20c3cd022925063d4c9b8d24a1f91fd8ca07.tar.gz |
Add -n for 2 remaining sysctl calls, also replace backtick by exec
-rw-r--r-- | etc/inc/config.inc | 2 | ||||
-rw-r--r-- | etc/inc/unbound.inc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc index 917f3a0..7ce4d72 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -137,7 +137,7 @@ else if ($g['booting'] and !file_exists($g['cf_conf_path'] . "/config.xml") ) { } else { if($g['booting']) echo "."; /* probe kernel known disks until we find one with config.xml */ - $disks = explode(" ", trim(preg_replace("/kern.disks: /", "", exec("/sbin/sysctl kern.disks")))); + $disks = explode(" ", trim(exec("/sbin/sysctl -n kern.disks"))); foreach ($disks as $mountdisk) { /* skip mfs mounted filesystems */ if (strstr($mountdisk, "md")) diff --git a/etc/inc/unbound.inc b/etc/inc/unbound.inc index aeaf0fc..b5de82f 100644 --- a/etc/inc/unbound.inc +++ b/etc/inc/unbound.inc @@ -45,7 +45,7 @@ function unbound_optimization() { * Set the number of threads equal to number of CPUs. * Use 1 to disable threading, if for some reason this sysctl fails. */ - $numprocs = intval(trim(`/sbin/sysctl kern.smp.cpus | /usr/bin/cut -d" " -f2`)); + $numprocs = intval(trim(exec('/sbin/sysctl -n kern.smp.cpus'))); if ($numprocs > 0) $optimization['number_threads'] = "num-threads: {$numprocs}"; else @@ -670,4 +670,4 @@ function unbound_hosts_generate() { unbound_control("reload"); } -?>
\ No newline at end of file +?> |