Use mountpoint to check for ESP
Instead of parsing the output of mount, use mountpoint to check if the ESP is mounted. This should be slightly less fragile than parsing text formatted for human consumption.
This commit is contained in:
parent
315e326b4d
commit
7122be957b
|
@ -97,18 +97,10 @@ $runConf{umount_on_exit} = 0;
|
|||
if ( nonempty $config{Global}{BootMountPoint} ) {
|
||||
my $mounted = 0;
|
||||
|
||||
my $cmd = "mount";
|
||||
my $cmd = "mountpoint $config{Global}{BootMountPoint}";
|
||||
my @output = execute($cmd);
|
||||
my $status = pop(@output);
|
||||
foreach my $line (@output) {
|
||||
chomp($line);
|
||||
if ( $line =~ m/$config{Global}{BootMountPoint}/ ) {
|
||||
$mounted = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
unless ($mounted) {
|
||||
unless ( $status eq 0 ) {
|
||||
print "Mounting $config{Global}{BootMountPoint}\n";
|
||||
$cmd = "mount $config{Global}{BootMountPoint}";
|
||||
my @output = execute($cmd);
|
||||
|
|
Loading…
Reference in New Issue