Skip to content

Commit

Permalink
Merge pull request #71 from mariux64/mxmount-add-noexport
Browse files Browse the repository at this point in the history
mxmount: Add option --noexport
  • Loading branch information
pmenzel authored Jan 30, 2019
2 parents 9cfbd35 + 35715cf commit c4cb6d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions mxmount/mxmount
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ my %D;
our $USAGE=<<"_EOF_";
usage: $0
$0 --reexport-only
$0 --noexport
_EOF_

our ($opt_reexport_only);
our ($opt_reexport_only,$opt_noexport);

$fullhostname = hostname();
($hostname) = $fullhostname =~ /^([^.]*)/;
Expand Down Expand Up @@ -52,12 +53,13 @@ add_data0_if_not_present();
my %options;
GetOptions (
'reexport-only' => \$opt_reexport_only,
'noexport' => \$opt_noexport,
) or die $USAGE;
@ARGV and die $USAGE;

mount_all() unless $opt_reexport_only;
create_exports();
system("exportfs -ra");
system("exportfs -ra") unless $opt_noexport;

sub safe_qx { open my $pipe,'-|',@_; return join('',<$pipe>) }

Expand Down
2 changes: 1 addition & 1 deletion mxmount/mxmount.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ConditionPathExists=/etc/mxmounts

[Service]
Type=oneshot
ExecStart=/usr/bin/mxmount
ExecStart=/usr/bin/mxmount --noexport
RemainAfterExit=yes

[Install]
Expand Down

0 comments on commit c4cb6d2

Please sign in to comment.