diff options
author | matteo <matteo.pasotti@gmail.com> | 2015-03-21 23:38:39 +0100 |
---|---|---|
committer | matteo <matteo.pasotti@gmail.com> | 2015-03-21 23:38:39 +0100 |
commit | ad15bccd4be2eb167e4399e27ad2f5df0aba6cb7 (patch) | |
tree | 13d0b6801aa23976a6c91135896b2cd9391831c9 | |
parent | a4c66f1f38f65c93b08d9126fec4b2d2b8b42a8e (diff) | |
parent | 373e49badf96d3650f60c7f87b453a894edc966b (diff) | |
download | manatools-ad15bccd4be2eb167e4399e27ad2f5df0aba6cb7.tar manatools-ad15bccd4be2eb167e4399e27ad2f5df0aba6cb7.tar.gz manatools-ad15bccd4be2eb167e4399e27ad2f5df0aba6cb7.tar.bz2 manatools-ad15bccd4be2eb167e4399e27ad2f5df0aba6cb7.tar.xz manatools-ad15bccd4be2eb167e4399e27ad2f5df0aba6cb7.zip |
Merge branch 'master' of ssh://git.mageia.org/software/adminpanel
-rw-r--r-- | Changes | 3 | ||||
-rw-r--r-- | lib/ManaTools/Shared/TimeZone.pm | 11 |
2 files changed, 11 insertions, 3 deletions
@@ -1,4 +1,7 @@ 1.0.1 27/03/2015 07:07 + - manaclock: fixed NTP server configuration and access + into /etc/systemd/timesyncd.conf + - manawall: fixed samba/cifs ports for samba-server entry - manaclock: actions are performed only on changes, also to avoid asking password when not needed in user space - manaclock: if no NTP is installed rise a warning in case of diff --git a/lib/ManaTools/Shared/TimeZone.pm b/lib/ManaTools/Shared/TimeZone.pm index e6b843fd..936515bb 100644 --- a/lib/ManaTools/Shared/TimeZone.pm +++ b/lib/ManaTools/Shared/TimeZone.pm @@ -848,7 +848,12 @@ sub ntpCurrentServer { my $configFile = $self->ntp_configuration_file || $self->getNTPServiceConfig($self->ntp_program); - MDK::Common::Func::find { $_ ne '127.127.1.0' } map { MDK::Common::Func::if_(/^\s*server\s+(\S*)/, $1) } MDK::Common::File::cat_($configFile); + if ($self->ntp_program eq "systemd-timesyncd") { + return MDK::Common::Func::find { $_ ne '127.127.1.0' } map { MDK::Common::Func::if_(/^\s*NTP=\s*(\S*)\s*(\S*)/, $1) } MDK::Common::File::cat_($configFile); + } + else { + return MDK::Common::Func::find { $_ ne '127.127.1.0' } map { MDK::Common::Func::if_(/^\s*server\s+(\S*)/, $1) } MDK::Common::File::cat_($configFile); + } } #============================================================= @@ -936,8 +941,8 @@ sub setNTPConfiguration { if ($self->ntp_program eq "systemd-timesyncd") { my $added = 0; MDK::Common::File::substInFile { - if (/^#?\s*NTP=\s+(\S*)/ && $1 ne '127.127.1.0') { - $_ = $added ? $_ =~ $pool_match ? undef : "#NTP=$1\n" : join('NTP= ', @servers, "\n"); + if (/^#?\s*NTP=\s*(\S*)/ && $1 ne '127.127.1.0') { + $_ = $added ? $_ =~ $pool_match ? undef : "#NTP=$1\n" : join(' ', 'NTP=', @servers, "\n"); $added = 1; } } $f; |