diff options
-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; |