Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
a3588a06
Commit
a3588a06
authored
Dec 03, 2004
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
account/tbacct.in
View file @
a3588a06
...
...
@@ -23,12 +23,13 @@ use Getopt::Std;
#
sub
usage
()
{
print
("
Usage: tbacct [-f]
"
.
print
("
Usage: tbacct [-f]
[-b]
"
.
"
<add|del|mod|passwd|freeze|thaw> <user>
\n
");
exit
(
-
1
);
}
my
$optlist
=
"
f
";
my
$force
=
0
;
my
$optlist
=
"
fb
";
my
$force
=
0
;
my
$batch
=
0
;
#
# Configure variables
...
...
@@ -115,6 +116,9 @@ if (! getopts($optlist, \%options)) {
if
(
defined
(
$options
{"
f
"}))
{
$force
=
1
;
}
if
(
defined
(
$options
{"
b
"}))
{
$batch
=
1
;
}
if
(
@ARGV
!=
2
)
{
usage
();
}
...
...
@@ -304,7 +308,8 @@ sub AddUser()
fatal
("
Could not generate initial ssh key for
$user
");
}
# Add to elists.
system
("
$GENELISTS
-u
$user
");
system
("
$GENELISTS
-u
$user
")
if
(
!
$batch
);
# Generate the SSL cert for the user.
system
("
$MKUSERCERT
$user
");
...
...
@@ -318,8 +323,10 @@ sub AddUser()
# could hang for a while if another update is in progress. Hmm, I
# do not like this.
#
print
"
Updating exports file.
\n
";
system
("
$EXPORTSSETUP
");
if
(
!
$batch
)
{
print
"
Updating exports file.
\n
";
system
("
$EXPORTSSETUP
");
}
$EUID
=
0
;
# SFS key.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment