From 41af31a47773b5011d0da431268dec91b63a634d Mon Sep 17 00:00:00 2001 From: Christian Belisle Date: Tue, 15 Jan 2002 13:18:27 +0000 Subject: if already mounted, don't re-mount. --- transfugdrake.pm | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'transfugdrake.pm') diff --git a/transfugdrake.pm b/transfugdrake.pm index 8b5cba6..3217fc5 100644 --- a/transfugdrake.pm +++ b/transfugdrake.pm @@ -116,21 +116,27 @@ sub mount_partition { my $win_partition = $_[1]; my $mountpoint = "/mnt/windows"; my @mounts; + my $mounted = 0; + my @tmp; (@mounts) = cat_('/proc/mounts'); foreach (@mounts) { - print "$_\n"; + @tmp = split(' ', $_); + print "$tmp[0]\n"; + if($tmp[0] eq $win_partition) { $mounted = 1; } } - if(-e $mountpoint) { - $mountpoint .= '2'; - } - mkdir($mountpoint); - - print "mount -t $fstype $win_partition $mountpoint\n"; - #if(`mount -t $fstype $win_partition $mountpoint`) { print "Error\n:"; } + if(!$mounted) { + if(-e $mountpoint) { + $mountpoint .= '2'; + } + mkdir($mountpoint); + print "mount -t $fstype $win_partition $mountpoint\n"; + if(`mount -t $fstype $win_partition $mountpoint`) { print "Error\n:"; } + } + return $mountpoint; } @@ -144,8 +150,6 @@ sub get_windows_config { # Mount it $config->{mountpoint} = mount_partition($config->{fstype}, $config->{partition}); - # Get the Windows version - $config->{version} = $get_windows_version($config->{mountpoint}); # Find where the documents are # If possible, get some registry config return %config; -- cgit v1.2.1