Only grab details (uuids, mountpoints) about a certain disk once.
In case there are multiple mounts of the same disk to different places,
the CGI got confused and messed up.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
my $device = $tmp[-1];
# Add the mountpoint to the hash of mountpoints.
- $mounts{"$device"} = $mpoint;
+ unless($mounts{"$device"}) {
+ $mounts{"$device"} = $mpoint;
+ }
}
# Close file handle.
$fs = lc($fs);
# Add the mounted file system.
- $mountedfs{$device} = $fs;
+ unless($mountedfs{$device}) {
+ $mountedfs{$device} = $fs;
+ }
}
# Close file handle.
my $dev = "$tmp[-1]";
# Add the device and uuid to the hash of uuids.
- $uuids{$dev} = $uuid;
+ unless($uuids{$dev}) {
+ $uuids{$dev} = $uuid;
+ }
}
# Close directory handle.