Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
56a7b44c
Commit
56a7b44c
authored
Nov 07, 2011
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add silent (-s) option and pass along.
parent
c0cea001
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
backend/newgroup.in
backend/newgroup.in
+9
-4
No files found.
backend/newgroup.in
View file @
56a7b44c
...
...
@@ -15,11 +15,12 @@ use Data::Dumper;
#
sub
usage
()
{
print
("
Usage: newgroup [-v] <xmlfile>
\n
");
print
("
Usage: newgroup [-v]
[-s]
<xmlfile>
\n
");
exit
(
-
1
);
}
my
$optlist
=
"
dv
";
my
$optlist
=
"
dv
s
";
my
$debug
=
0
;
my
$silent
=
0
;
my
$verify
=
0
;
# Check data and return status only.
#
...
...
@@ -66,6 +67,9 @@ if (! getopts($optlist, \%options)) {
if
(
defined
(
$options
{"
d
"}))
{
$debug
=
1
;
}
if
(
defined
(
$options
{"
s
"}))
{
$silent
=
1
;
}
if
(
defined
(
$options
{"
v
"}))
{
$verify
=
1
;
}
...
...
@@ -355,7 +359,8 @@ my $group_idx = $new_group->gid_idx();
#
# Run the script to make the group directory, set the perms, etc.
#
my
$cmd
=
"
mkgroup
$group_idx
";
my
$opt
=
(
$silent
?
"
-s
"
:
"");
my
$cmd
=
"
mkgroup
$opt
$group_idx
";
print
(
$cmd
.
"
\n
")
if
(
$debug
);
system
(
$cmd
);
...
...
@@ -366,7 +371,7 @@ fatal("Failed: '$cmd'")
# Now add the group leader to the group.
#
my
$safe_id
=
escapeshellarg
(
$group_id
);
$cmd
=
"
modgroups -a
$group_pid
:
$safe_id
:group_root
$group_leader
";
$cmd
=
"
modgroups
$opt
-a
$group_pid
:
$safe_id
:group_root
$group_leader
";
print
(
$cmd
.
"
\n
")
if
(
$debug
);
system
(
$cmd
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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