summaryrefslogtreecommitdiffstats
path: root/time_wizard
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2005-07-04 10:35:03 +0000
committerAntoine Ginies <aginies@mandriva.com>2005-07-04 10:35:03 +0000
commitbfefcdde183429ce5d57f488433902d9c2c250af (patch)
treef3d7b1c00fab7ad1cd883a91a3985281a204a554 /time_wizard
parentf91f72fc708fdcd87bdea31993274a455855cd82 (diff)
downloaddrakwizard-bfefcdde183429ce5d57f488433902d9c2c250af.tar
drakwizard-bfefcdde183429ce5d57f488433902d9c2c250af.tar.gz
drakwizard-bfefcdde183429ce5d57f488433902d9c2c250af.tar.bz2
drakwizard-bfefcdde183429ce5d57f488433902d9c2c250af.tar.xz
drakwizard-bfefcdde183429ce5d57f488433902d9c2c250af.zip
use progress_bar in wait message
Diffstat (limited to 'time_wizard')
-rw-r--r--time_wizard/Ntp.pm36
1 files changed, 16 insertions, 20 deletions
diff --git a/time_wizard/Ntp.pm b/time_wizard/Ntp.pm
index b7dd9f31..f666944e 100644
--- a/time_wizard/Ntp.pm
+++ b/time_wizard/Ntp.pm
@@ -26,6 +26,7 @@ use strict;
use common;
use services;
+use MDK::Wizard::Wizcommon;
require MDK::Wizard::Wizcommon;
my $wiz = new MDK::Wizard::Wizcommon;
@@ -183,16 +184,19 @@ sub get_timezone {
}
sub test {
- if ($::testing) {
- do_it();
- return 'end';
- }
- system("/usr/sbin/ntpdate -q $o->{var}{varserver1} $o->{var}{varserver2}");
- if (!($? >> 8)) {
- do_it();
- return 'end'
- }
- 'server_not_responding'
+ if ($::testing) {
+ do_it();
+ return 'end';
+ }
+ my $command = "/usr/sbin/ntpdate -q $o->{var}{varserver1}"; # $o->{var}{varserver2}";
+ my $o = wizard_progress_bar($command, "Test NTP server Responding...");
+ $o;
+ # system("/usr/sbin/ntpdate -q $o->{var}{varserver1} $o->{var}{varserver2}");
+ if (!($? >> 8)) {
+ do_it();
+ return 'end'
+ }
+ 'server_not_responding'
}
sub do_it {
@@ -217,16 +221,8 @@ sub do_it {
close NEW or die "can not close /etc/ntp/step-tickers: $!";
substInFile { s/(# server clock.via.net)/$1\nserver $o->{var}{varserver1}/ } '/etc/ntp.conf' if -f '/etc/ntp.conf';
standalone::explanations("Wrote /etc/ntp/step-tickers, starting services");
- my @services = qw(crond atd ntpd);
- foreach (@services) {
- if (services::is_service_running($_)) {
- services::stop($_)
- }
- }
- foreach (reverse @services) {
- services::start($_)
- }
- system("/sbin/hwclock --systohc --utc");
+ my $command = "service crond stop; service atd stop; service ntpd stop; service ntpd start; service atd start; service crond start; /sbin/hwclock --systohc --utc";
+ wizard_progress_bar($command, "Configuring NTP, ATD and CROND services...");
}
1;