Skip to content

Commit

Permalink
mxraid_assemble: specify database file as option
Browse files Browse the repository at this point in the history
This allows checkin the db-file before it gets disted.
  • Loading branch information
thomas committed Mar 15, 2018
1 parent ee00118 commit 1031e24
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mxraid/mxraid_assemble
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ sub exec_usage {
-a assemble arrays when run as root
-c check database
-d file alternative database file
-h print this help and exit
-q be quiet
-v be more verbose
Expand Down Expand Up @@ -62,7 +63,7 @@ sub exec_version {
my $ROOT=$<==0?1:0;

my %opts;
getopts('achqvV', \%opts) or die "# ERROR: getopts failed, try -h.\n"; # Values in %opts
getopts('acd:hqvV', \%opts) or die "# ERROR: getopts failed, try -h.\n"; # Values in %opts
exec_usage if $opts{h};
exec_version if $opts{V};

Expand All @@ -73,6 +74,15 @@ $VERBOSE+=1 if $opts{v};


my $MDADMCONF_DB = '/etc/mxmd.conf'; # the 'database' with serials
if ($opts{d}) {
my $db = $opts{d};
if (-e $db) {
$MDADMCONF_DB = $db;
} else {
die "# db file '$db' does not exist, stopped";
}
}

my $MDADM_CONF_BASE = '/dev/shm/mdadm.conf'; # config for mdadm, created with information from above

my $MDADM_ASSEMBLE_OPTIONS = '';
Expand Down

0 comments on commit 1031e24

Please sign in to comment.