summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr/local/www/widgets/widgets/ntp_status.widget.php9
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);
OpenPOWER on IntegriCloud