ref: refs/heads/master
commit 94f7662051eb6ea3dea9c6381305147b1d860a2c
Author: Josef Reidinger
Date: Thu Sep 3 15:14:24 2009 +0200
add inital YaPI for ntp, (it is YaPI but due to bad YaST ntp-client condition it doesn't use it)
---
plugins/time/package/NTP.pm | 21 ++++++++++++++++++++
.../org.opensuse.yast.modules.yapi.ntp.policy | 19 ++++++++++++++++++
2 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/plugins/time/package/NTP.pm b/plugins/time/package/NTP.pm
new file mode 100644
index 0000000..36b401b
--- /dev/null
+++ b/plugins/time/package/NTP.pm
@@ -0,0 +1,21 @@
+package YaPI::NTP;
+
+use strict;
+use YaPI;
+
+BEGIN{$TYPEINFO{Synchronize} = ["function",
+ "string","string"];
+sub Synchronize {
+ my $self = shift;
+ my $server = shift;
+
+ # -r: do set the system time
+ # -P no: do not ask if time difference is too large
+ # -c 1 -d 15: delay 15s, only one try (bnc#442287)
+ $out = `/usr/sbin/sntp -c 1 -d 15 -r -P no '$server' 2>&1`
+ if ($?){
+ return $out;
+ } else {
+ return "OK"
+ }
+}
diff --git a/plugins/time/package/org.opensuse.yast.modules.yapi.ntp.policy b/plugins/time/package/org.opensuse.yast.modules.yapi.ntp.policy
new file mode 100644
index 0000000..070184f
--- /dev/null
+++ b/plugins/time/package/org.opensuse.yast.modules.yapi.ntp.policy
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+ "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
+<policyconfig>
+
+ <vendor>YaST Webservice Project</vendor>
+ http://en.opensuse.org/YAST
+
+ <action id="org.opensuse.yast.modules.yapi.ntp.synchronize">
+ <description>One time synchronization agaijn given ntp server</description>
+ <message>Authentication is required to onetime synchronize with ntp</message>
+ <defaults>
+ no
+ no
+ </defaults>
+ </action>
+
+</policyconfig>
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org