From: Stefan Schantl Date: Mon, 17 May 2021 20:32:21 +0000 (+0200) Subject: extrahd.cgi: Use new system methods X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83b25d0964bf208fe50d439ca7388a02691bacd2;p=people%2Fstevee%2Fipfire-2.x.git extrahd.cgi: Use new system methods Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index e277abd511..154efd7b28 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -103,7 +103,7 @@ END } elsif ($extrahdsettings{'ACTION'} eq $Lang::tr{'delete'}) { - if ( `/usr/local/bin/extrahdctrl umount $extrahdsettings{'PATH'}` ) { + if ( &General::system("/usr/local/bin/extrahdctrl", "umount", "$extrahdsettings{'PATH'}")) { open( FILE, "< $devicefile" ) or die "Unable to read $devicefile"; @tmp = ; close FILE; @@ -143,7 +143,11 @@ END { @deviceline = split( /\;/, $deviceentry ); my $color="$Header::colourred"; - if ( ! `/bin/mountpoint $deviceline[2] | grep " not "` ) { + + # Use safe system_output to get mountpoint details. + my @mountpoint = &General::system_output("/bin/mountpoint", "$deviceline[2]"); + + if ( ! grep(/not/, @mountpoint)) { $color=$Header::colourgreen; } print <