}
else {
print &ui_form_end([ [ undef, $text{'save'} ],
- [ 'start', $text{'index_start'} ],
- [ 'stop', $text{'index_stop'} ],
+ [ 'start', $text{'edit_startnow'} ],
+ [ 'stop', $text{'edit_stopnow'} ],
[ 'delete', $text{'delete'} ] ]);
}
# Config file exists, make sure it is enabled
&system_logged("insserv ".quotemeta($_[0])." >/dev/null 2>&1");
my $lref = &read_file_lines($cfile);
+ my $foundstart;
foreach my $l (@$lref) {
- if ($l =~ /^#+\s*start/) {
+ if ($l =~ /^#+start/) {
+ # Start of start block
$l =~ s/^#+//;
+ $foundstart = 1;
+ }
+ elsif ($l =~ /^#+\s+\S/ && $foundstart) {
+ # Continuation line for start
+ $l =~ s/^#+//;
+ }
+ elsif ($l =~ /^\S/ && $foundstart) {
+ # Some other directive after start
last;
}
}
my $cfile = "/etc/init/$_[0].conf";
if (-r $cfile) {
my $lref = &read_file_lines($cfile);
+ my $foundstart;
foreach my $l (@$lref) {
- if ($l =~ /^\s*start/) {
+ if ($l =~ /^start\s/) {
+ # Start of start block
$l = "#".$l;
+ $foundstart = 1;
+ }
+ elsif ($l =~ /^\s+\S/ && $foundstart) {
+ # Continuation line for start
+ $l = "#".$l;
+ }
+ elsif ($l =~ /^\S/ && $foundstart) {
+ # Some other directive after start
last;
}
}
upstart_edesc=Missing service description
upstart_eserver=No server command entered
upstart_eserver2=Server command does not exist
+upstart_return=upstart service
__norefs=1
join(" ", @sel));
}
-&ui_print_footer("", $text{'index_return'});
+if ($in{'return'}) {
+ &ui_print_footer("edit_upstart.cgi?name=".&urlize($in{'return'}),
+ $text{'upstart_return'});
+ }
+else {
+ &ui_print_footer("", $text{'index_return'});
+ }
if ($in{'start'} || $in{'stop'}) {
# Just redirect to the start page
- &redirect("mass_upstarts.cgi?d=".&urlize($in{'name'}).
- ($in{'start'} ? "start=1" : "stop=1"));
+ &redirect("mass_upstarts.cgi?d=".&urlize($in{'name'})."&".
+ ($in{'start'} ? "start=1" : "stop=1").
+ "&return=".&urlize($in{'name'}));
exit;
}