Skip to content

Commit

Permalink
mxmount: Remove some lines which don't have a function
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Nov 19, 2018
1 parent 635eede commit 1d9bd5d
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions mxmount/mxmount
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
#!/usr/bin/perl

use Sys::Hostname;
use Data::Dumper;
use Socket;

use warnings;

########################################

my $configfile = "/etc/mxmounts";
my $exports = "/etc/exports";

########################################

my $exportstag = "# DO NOT EDIT BELOW THIS LINE # created by /usr/bin/mxmount #";

my $fullhostname;
Expand Down Expand Up @@ -45,8 +38,6 @@ foreach(@lines) {
print STDERR "skipping: '$_'\n";
}

#print Dumper \%D;

add_data0_if_not_present();
mount_all();
create_exports();
Expand All @@ -67,13 +58,9 @@ sub add_data0_if_not_present {
return;
}
}

# print "no data0 found\n";
parse_data("$hostname !data0");
# print Dumper $D{$hostname};
}


sub create_exports {
my $allmp = $D{$hostname};
my @CMD;
Expand All @@ -86,7 +73,6 @@ sub create_exports {
last if($exp eq $exportstag);
print EXPORTS "$exp\n";
}

print EXPORTS "\n$exportstag\n\n";

foreach my $mp (@$allmp) {
Expand All @@ -97,11 +83,9 @@ sub create_exports {
print EXPORTS join " ", @CMD, "\n";

}

close EXPORTS;
}


sub mount_all {
my $allmp = $D{$hostname};
my @CMD;
Expand Down Expand Up @@ -143,8 +127,6 @@ sub parse_data {
$D->{line} = $_;

$D->{host} = $data[0];


$D->{label} = $data[1];
if($D->{label} =~ /^!(.*)/) {
$D->{noexport} = 1;
Expand Down Expand Up @@ -193,8 +175,6 @@ sub parse_data {
foreach(qw(host label mountpoint fs mountopts exportopts )) {
$D->{$_} = expand_variables($D->{$_});
}


push @{$D{$D->{host}}}, $D;
}
return @invalid;
Expand All @@ -206,11 +186,9 @@ sub expand_variables {
foreach my $k (keys %V) {
$s =~ s/$k/$V{$k}/g;
}

return $s;
}


sub parse_variables {
my @lines = @_;
my @invalid = ();
Expand Down Expand Up @@ -260,7 +238,6 @@ sub read_file {
$line="";
}
}

close F;
return @lines;
}
Expand Down

0 comments on commit 1d9bd5d

Please sign in to comment.