diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-06-26 11:31:51 +0200 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-06-26 11:31:51 +0200 |
commit | e55b344a4b541d1c6d3f4a7589d37defc4a8efb2 (patch) | |
tree | eca2ace9115c3fd4df2cc504e35e6b9655a03ad3 /lib/AdminPanel/Shared | |
parent | 4218d4c3becab91e45f461d3b8722e408cb64f79 (diff) | |
download | colin-keep-e55b344a4b541d1c6d3f4a7589d37defc4a8efb2.tar colin-keep-e55b344a4b541d1c6d3f4a7589d37defc4a8efb2.tar.gz colin-keep-e55b344a4b541d1c6d3f4a7589d37defc4a8efb2.tar.bz2 colin-keep-e55b344a4b541d1c6d3f4a7589d37defc4a8efb2.tar.xz colin-keep-e55b344a4b541d1c6d3f4a7589d37defc4a8efb2.zip |
Added isNTPRunning
Diffstat (limited to 'lib/AdminPanel/Shared')
-rw-r--r-- | lib/AdminPanel/Shared/TimeZone.pm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/AdminPanel/Shared/TimeZone.pm b/lib/AdminPanel/Shared/TimeZone.pm index 1af6508..971ea94 100644 --- a/lib/AdminPanel/Shared/TimeZone.pm +++ b/lib/AdminPanel/Shared/TimeZone.pm @@ -57,6 +57,7 @@ use Moose; use DateTime::TimeZone; use Config::Auto; use AdminPanel::Shared::Locales; +use AdminPanel::Shared::Services; use MDK::Common::File; use MDK::Common::Func; @@ -441,6 +442,27 @@ sub ntpCurrentServer { MDK::Common::Func::find { $_ ne '127.127.1.0' } map { MDK::Common::Func::if_(/^\s*server\s+(\S*)/, $1) } MDK::Common::File::cat_($self->ntp_configuration_file); } +#============================================================= + +=head2 isNTPRunning + +=head3 DESCRIPTION + + This method just returns if the given ntp server is running + +=cut + +#============================================================= + +sub isNTPRunning { + my$self = shift; + + # TODO is that valid for any ntp program? adding ntp_service_name parameter + my $ntpd = $self->ntp_program . 'd'; + + return !AdminPanel::Shared::Services::is_service_running($ntpd); +} + no Moose; __PACKAGE__->meta->make_immutable; |