Reviewed-by: Michael Tremer > On 11 Oct 2022, at 23:01, Robin Roevens wrote: > > * Add restart action to services. > * Only display available actions for a service: > Start when service is stopped or Stop and Restart when a service > is running. > > Signed-off-by: Robin Roevens > --- > html/cgi-bin/services.cgi | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi > index e35b04cae..4b379251e 100644 > --- a/html/cgi-bin/services.cgi > +++ b/html/cgi-bin/services.cgi > @@ -143,7 +143,7 @@ END > my @param=split(/!/, $paramstr); > # Make sure action parameter is actually one of the allowed service actions > given ($param[1]) { > - when ( ['start', 'stop', 'enable', 'disable'] ) { > + when ( ['start', 'stop', 'restart', 'enable', 'disable'] ) { > # Make sure pak-name and service name don't contain any illegal character > if ( $param[0] !~ /[^a-zA-Z_0-9\-]/ && > $param[2] !~ /[^a-zA-Z_0-9\-]/ ) { > @@ -196,8 +196,6 @@ END > > my $status = isautorun($pak,$service,$col); > print "$status "; > - print "$Lang::tr{"; > - print "$Lang::tr{ "; > my $status = isrunningaddon($pak,$service,$col); > $status =~ s/\\[[0-1]\;[0-9]+m//g; > > @@ -307,7 +305,9 @@ sub isrunningaddon (@) { > my $testcmd = @testcmd[0]; > > if ( $testcmd =~ /is\ running/ && $testcmd !~ /is\ not\ running/){ > - $status = "$Lang::tr{'running'}"; > + $status = "$Lang::tr{ "; > + $status .= "$Lang::tr{ "; > + $status .= "$Lang::tr{'running'}"; > $testcmd =~ s/.* //gi; > $testcmd =~ s/[a-z_]//gi; > $testcmd =~ s/\[[0-1]\;[0-9]+//gi; > @@ -330,7 +330,8 @@ sub isrunningaddon (@) { > } > $status .="$memory KB"; > }else{ > - $status = "$Lang::tr{'stopped'}"; > + $status = "$Lang::tr{"; > + $status .= "$Lang::tr{'stopped'}"; > } > return $status; > } > -- > 2.37.3 > > > -- > Dit bericht is gescanned op virussen en andere gevaarlijke > inhoud door MailScanner en lijkt schoon te zijn. >