pakfire.cgi: Notify user if Pakfire is already performing a task

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Acked-by: Peter Müller <peter.muelle@ipfire.org>
This commit is contained in:
Leo-Andres Hofmann
2022-05-08 14:09:49 +02:00
committed by Peter Müller
parent 4b5d1f3001
commit 3cdb83939b
3 changed files with 6 additions and 2 deletions

View File

@@ -96,8 +96,10 @@ if($cgiparams{'ACTION'} eq 'json-getstatus') {
}
### Process Pakfire install/update commands ###
if(($cgiparams{'ACTION'} ne '') && (! &_is_pakfire_busy())) {
if(($cgiparams{'ACTION'} eq 'install') && ($cgiparams{'FORCE'} eq 'on')) {
if($cgiparams{'ACTION'} ne '') {
if(&_is_pakfire_busy()) {
$errormessage = $Lang::tr{'pakfire already busy'};
} elsif(($cgiparams{'ACTION'} eq 'install') && ($cgiparams{'FORCE'} eq 'on')) {
my @pkgs = split(/\|/, $cgiparams{'INSPAKS'});
&General::system_background("/usr/local/bin/pakfire", "install", "--non-interactive", "--no-colors", @pkgs);
} elsif(($cgiparams{'ACTION'} eq 'remove') && ($cgiparams{'FORCE'} eq 'on')) {