From 1d9bd5d0ceeb64e2a7410a4a5dd37887a0d18c9d Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 19 Nov 2018 11:49:44 +0100 Subject: [PATCH] mxmount: Remove some lines which don't have a function --- mxmount/mxmount | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/mxmount/mxmount b/mxmount/mxmount index 0a4c366..44ec7e5 100755 --- a/mxmount/mxmount +++ b/mxmount/mxmount @@ -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; @@ -45,8 +38,6 @@ foreach(@lines) { print STDERR "skipping: '$_'\n"; } -#print Dumper \%D; - add_data0_if_not_present(); mount_all(); create_exports(); @@ -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; @@ -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) { @@ -97,11 +83,9 @@ sub create_exports { print EXPORTS join " ", @CMD, "\n"; } - close EXPORTS; } - sub mount_all { my $allmp = $D{$hostname}; my @CMD; @@ -143,8 +127,6 @@ sub parse_data { $D->{line} = $_; $D->{host} = $data[0]; - - $D->{label} = $data[1]; if($D->{label} =~ /^!(.*)/) { $D->{noexport} = 1; @@ -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; @@ -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 = (); @@ -260,7 +238,6 @@ sub read_file { $line=""; } } - close F; return @lines; }