log_modify=Modified action $1
log_create=Created action $1
log_delete=Deleted action $1
-log_start=Started bootup action $1
-log_stop=Stopped shutdown action $1
+log_start=Started action $1
+log_stop=Stopped action $1
+log_restart=Restarted action $1
+log_condrestart=Conditionally restarted action $1
+log_reload=Reloaded action $1
+log_status=Fetched status of action $1
log_reboot=Rebooted system
log_shutdown=Shutdown system
log_local=Modified bootup script
elsif ($action eq 'delete') {
return &text('log_delete', "<tt>$object</tt>");
}
-elsif ($action eq 'start') {
- return &text('log_start', "<tt>$object</tt>");
- }
-elsif ($action eq 'stop') {
- return &text('log_stop', "<tt>$object</tt>");
+elsif ($type eq 'action') {
+ return &text('log_'.$action, "<tt>$object</tt>");
}
elsif ($action eq 'reboot') {
return $text{'log_reboot'};
# Work out the correct command, and show header
$| = 1;
$theme_no_header = 1;
-if (defined($in{'start'})) {
- &ui_print_header(undef, $text{'ss_start'}, "");
- $cmd = "$in{'file'} start";
- }
-elsif (defined($in{'restart'})) {
- &ui_print_header(undef, $text{'ss_restart'}, "");
- $cmd = "$in{'file'} restart";
- }
-elsif (defined($in{'condrestart'})) {
- &ui_print_header(undef, $text{'ss_restart'}, "");
- $cmd = "$in{'file'} condrestart";
- }
-elsif (defined($in{'reload'})) {
- &ui_print_header(undef, $text{'ss_reload'}, "");
- $cmd = "$in{'file'} reload";
- }
-elsif (defined($in{'status'})) {
- &ui_print_header(undef, $text{'ss_status'}, "");
- $cmd = "$in{'file'} status";
- }
-else {
- &ui_print_header(undef, $text{'ss_stop'}, "");
- $cmd = "$in{'file'} stop";
+foreach $a ('start', 'restart', 'condrestart', 'reload', 'status', 'stop') {
+ if (defined($in{$a})) {
+ $action = $a;
+ }
}
+$action ||= 'stop';
+&ui_print_header(undef, $text{'ss_'.$action}, "");
+$cmd = $in{'file'}." ".$action;
# In case the action was Webmin
$SIG{'TERM'} = 'IGNORE';
print "<pre>";
&foreign_call("proc", "safe_process_exec_logged", $cmd, 0, 0, STDOUT, undef, 1);
print "</pre>\n";
-&webmin_log($in{'start'} ? 'start' : 'stop', 'action', $in{'name'});
+&webmin_log($action, 'action', $in{'name'});
&ui_print_footer($in{'back'}, $text{'edit_return'});