diff options
author | Phil Davis <phil.davis@inf.org> | 2014-12-04 13:44:20 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2014-12-04 13:44:20 +0545 |
commit | c2914fc9843b1eda695fc3fbbe04a12fd3100fdd (patch) | |
tree | 21fc3a36b98399cc228633af62eb2ccc658a745f /usr/local/www | |
parent | e26effd34041d9bbb8c712ce3098b5d296967325 (diff) | |
download | pfsense-c2914fc9843b1eda695fc3fbbe04a12fd3100fdd.zip pfsense-c2914fc9843b1eda695fc3fbbe04a12fd3100fdd.tar.gz |
Use IPv4 for ntpq if IPv6 not allowed in widget #4074
Similar code here. Shame it was not in a subroutine called from both places, but not about to re-engineer that now:)
Diffstat (limited to 'usr/local/www')
-rw-r--r-- | usr/local/www/widgets/widgets/ntp_status.widget.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr/local/www/widgets/widgets/ntp_status.widget.php b/usr/local/www/widgets/widgets/ntp_status.widget.php index 22c51d7..68c27e1 100644 --- a/usr/local/www/widgets/widgets/ntp_status.widget.php +++ b/usr/local/www/widgets/widgets/ntp_status.widget.php @@ -43,7 +43,12 @@ require_once("/usr/local/www/widgets/include/ntp_status.inc"); if($_REQUEST['updateme']) { //this block displays only on ajax refresh - exec("/usr/local/sbin/ntpq -pn | /usr/bin/tail +3", $ntpq_output); + if (isset($config['system']['ipv6allow'])) + $inet_version = ""; + else + $inet_version = " -4"; + + exec("/usr/local/sbin/ntpq -pn $inet_version | /usr/bin/tail +3", $ntpq_output); $ntpq_counter = 0; foreach ($ntpq_output as $line) { if (substr($line, 0, 1) == "*") { @@ -65,7 +70,7 @@ if($_REQUEST['updateme']) { } } - exec("/usr/local/sbin/ntpq -c clockvar", $ntpq_clockvar_output); + exec("/usr/local/sbin/ntpq -c clockvar $inet_version", $ntpq_clockvar_output); foreach ($ntpq_clockvar_output as $line) { if (substr($line, 0, 9) == "timecode=") { $tmp = explode('"', $line); |