diff --git a/time/apply.cgi b/time/apply.cgi index 517187d72..d9397a82f 100755 --- a/time/apply.cgi +++ b/time/apply.cgi @@ -52,17 +52,9 @@ if ($in{'action'} eq $text{'action_sync'}) { } elsif ($in{'action'} eq $text{'index_sync'} || $in{'mode'} eq 'ntp') { # Sync with a time server $access{'ntp'} || &error($text{'acl_nontp'}); - if (!$time_is_chrony) { - $in{'timeserver'} =~ /\S/ || &error($text{'error_etimeserver'}); - } + $in{'timeserver'} =~ /\S/ || &error($text{'error_etimeserver'}); $err = &sync_time($in{'timeserver'}, $in{'hardware'}); - if ($err) { - my $err_ = "
".&html_escape($err)."
"; - if ($time_out_no_cmd) { - $err_ = $err; - } - &error($err_); - } + &error("
".&html_escape($err)."
") if ($err); # Save settings in module config &lock_file($module_config_file); diff --git a/time/index.cgi b/time/index.cgi index fdd42af2d..530674012 100755 --- a/time/index.cgi +++ b/time/index.cgi @@ -3,7 +3,7 @@ use strict; use warnings; require './time-lib.pl'; -our (%in, %text, %config, %access, $base_remote_user, $get_hardware_time_error, $time_is_chrony); +our (%in, %text, %config, %access, $base_remote_user, $get_hardware_time_error); my ($rawdate, $rawhwdate, %system_date, $rawtime, %hw_date, $txt); $txt = ""; @@ -159,23 +159,16 @@ if ( ( !$access{ 'sysdate' } && &has_command( "date" ) || !$access{ 'hwdate' } & print &ui_hidden("mode", "ntp"); print &ui_table_start(&hlink($text{'index_timeserver'}, "timeserver"), "width=100%", 2, [ "width=30%" ]); - if (!$time_is_chrony) { - print &ui_table_row($text{'index_addresses'}, - &ui_textbox("timeserver", $config{'timeserver'}, 60)); - - # Show hardware time checkbox - if (&support_hwtime()) { - print &ui_table_row(" ", - &ui_checkbox("hardware", 1, $text{'index_hardware2'}, - $config{'timeserver_hardware'})); - } + + print &ui_table_row($text{'index_addresses'}, + &ui_textbox("timeserver", $config{'timeserver'}, 60)); + + # Show hardware time checkbox + if (&support_hwtime()) { + print &ui_table_row(" ", + &ui_checkbox("hardware", 1, $text{'index_hardware2'}, + $config{'timeserver_hardware'})); } - else { - if (&support_hwtime()) { - print &ui_table_row($text{'action_sync_s'}, - &ui_yesno_radio("hardware", $config{'timeserver_hardware'})); - } - } # Show boot-time checkbox my $job = &find_webmin_cron_job(); diff --git a/time/time-lib.pl b/time/time-lib.pl index 7c0551587..dd4d6b254 100755 --- a/time/time-lib.pl +++ b/time/time-lib.pl @@ -11,8 +11,6 @@ our ($timezones_file, $currentzone_link, $currentzone_file, $timezones_dir, $sysclock_file); our ($get_hardware_time_error); our $cron_cmd = "$module_config_directory/sync.pl"; -our $time_is_chrony = &has_command("chronyc"); -our $time_out_no_cmd = 0; if ($config{'zone_style'}) { do "$config{'zone_style'}-lib.pl"; } @@ -42,18 +40,14 @@ my ($server, $hwtoo) = @_; my @servs = split(/\s+/, $server); my $servs = join(" ", map { quotemeta($_) } @servs); my $out; -if ($time_is_chrony) { - $out = &backquote_logged("chronyc -a makestep 2>&1"); - } -elsif (&has_command("ntpdate")) { +if (&has_command("ntpdate")) { $out = &backquote_logged("ntpdate -u $servs 2>&1"); } elsif (&has_command("sntp")) { $out = &backquote_logged("sntp -s $servs 2>&1"); } else { - $out = "Missing chronyc or ntpdate and sntp commands"; - $time_out_no_cmd = 1; + $out = "Missing ntpdate and sntp commands"; $? = 1; } if ($? && $config{'ntp_only'}) {