mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
extrahd.cgi: Abort if a device could not be umounted.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
56ce3e19e6
commit
94aeac8a05
@@ -146,8 +146,7 @@ if ($extrahdsettings{'ACTION'} eq $Lang::tr{'add'}) {
|
||||
#
|
||||
} elsif ($extrahdsettings{'ACTION'} eq $Lang::tr{'delete'}) {
|
||||
# Call helper binary to unmount the device.
|
||||
&General::system("/usr/local/bin/extrahdctrl", "umount", "$extrahdsettings{'PATH'}");
|
||||
|
||||
unless(&General::system("/usr/local/bin/extrahdctrl", "umount", "$extrahdsettings{'PATH'}")) {
|
||||
# Open the device file for reading.
|
||||
open(FILE, "< $devicefile" ) or die "Unable to read $devicefile";
|
||||
|
||||
@@ -173,6 +172,9 @@ if ($extrahdsettings{'ACTION'} eq $Lang::tr{'add'}) {
|
||||
|
||||
# Close file handle.
|
||||
close(FILE);
|
||||
} else {
|
||||
$errormessage = "$Lang::tr{'extrahd cant umount'} $extrahdsettings{'PATH'}$Lang::tr{'extrahd maybe the device is in use'}?";
|
||||
}
|
||||
}
|
||||
|
||||
if ($errormessage) {
|
||||
|
||||
Reference in New Issue
Block a user