Merge pull request #1361 from phil-davis/patch-2

This commit is contained in:
Chris Buechler 2014-12-04 00:12:17 -06:00
commit 888dd4949a

View File

@ -45,8 +45,12 @@
require_once("guiconfig.inc");
if(!isset($config['ntpd']['noquery'])) {
if (isset($config['system']['ipv6allow']))
$inet_version = "";
else
$inet_version = " -4";
exec("/usr/local/sbin/ntpq -pn | /usr/bin/tail +3", $ntpq_output);
exec("/usr/local/sbin/ntpq -pn $inet_version | /usr/bin/tail +3", $ntpq_output);
$ntpq_servers = array();
foreach ($ntpq_output as $line) {
@ -96,7 +100,7 @@ if(!isset($config['ntpd']['noquery'])) {
$ntpq_servers[] = $server;
}
exec("/usr/local/sbin/ntpq -c clockvar", $ntpq_clockvar_output);
exec("/usr/local/sbin/ntpq -c $inet_version clockvar", $ntpq_clockvar_output);
foreach ($ntpq_clockvar_output as $line) {
if (substr($line, 0, 9) == "timecode=") {
$tmp = explode('"', $line);