diff options
author | Phil Davis <phil.davis@inf.org> | 2014-12-04 13:44:20 +0545 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-12-04 08:01:43 -0200 |
commit | 9bcb09195202d6e1957fc3b2be57d8f6444c43c0 (patch) | |
tree | 21fc3a36b98399cc228633af62eb2ccc658a745f /usr | |
parent | e26effd34041d9bbb8c712ce3098b5d296967325 (diff) | |
download | pfsense-9bcb09195202d6e1957fc3b2be57d8f6444c43c0.zip pfsense-9bcb09195202d6e1957fc3b2be57d8f6444c43c0.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')
-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); |