Commit a3588a06 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Add a batch mode so that the elists and exports are not updated for

every new user during a elabinelab setup. Save it all for the end.
parent 1afff00b
...@@ -23,12 +23,13 @@ use Getopt::Std; ...@@ -23,12 +23,13 @@ use Getopt::Std;
# #
sub usage() sub usage()
{ {
print("Usage: tbacct [-f] ". print("Usage: tbacct [-f] [-b] ".
"<add|del|mod|passwd|freeze|thaw> <user>\n"); "<add|del|mod|passwd|freeze|thaw> <user>\n");
exit(-1); exit(-1);
} }
my $optlist = "f"; my $optlist = "fb";
my $force = 0; my $force = 0;
my $batch = 0;
# #
# Configure variables # Configure variables
...@@ -115,6 +116,9 @@ if (! getopts($optlist, \%options)) { ...@@ -115,6 +116,9 @@ if (! getopts($optlist, \%options)) {
if (defined($options{"f"})) { if (defined($options{"f"})) {
$force = 1; $force = 1;
} }
if (defined($options{"b"})) {
$batch = 1;
}
if (@ARGV != 2) { if (@ARGV != 2) {
usage(); usage();
} }
...@@ -304,7 +308,8 @@ sub AddUser() ...@@ -304,7 +308,8 @@ sub AddUser()
fatal("Could not generate initial ssh key for $user"); fatal("Could not generate initial ssh key for $user");
} }
# Add to elists. # Add to elists.
system("$GENELISTS -u $user"); system("$GENELISTS -u $user")
if (! $batch);
# Generate the SSL cert for the user. # Generate the SSL cert for the user.
system("$MKUSERCERT $user"); system("$MKUSERCERT $user");
...@@ -318,8 +323,10 @@ sub AddUser() ...@@ -318,8 +323,10 @@ sub AddUser()
# could hang for a while if another update is in progress. Hmm, I # could hang for a while if another update is in progress. Hmm, I
# do not like this. # do not like this.
# #
print "Updating exports file.\n"; if (! $batch) {
system("$EXPORTSSETUP"); print "Updating exports file.\n";
system("$EXPORTSSETUP");
}
$EUID = 0; $EUID = 0;
# SFS key. # SFS key.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment