Skip to content
GitLab
Menu
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
e711a5bb
Commit
e711a5bb
authored
Dec 29, 2017
by
Leigh B Stoller
Browse files
Add -T option to also specify the tipline info.
parent
dc90a087
Changes
1
Hide whitespace changes
Inline
Side-by-side
utils/addmanagementiface.in
View file @
e711a5bb
...
...
@@ -36,7 +36,7 @@ use File::Temp qw(tempfile);
#
sub
usage
()
{
print
STDERR
"
Usage: management
_
iface -t <type> -a [key|pswd]
";
print
STDERR
"
Usage:
add
managementiface -t <type> -a [key|pswd]
";
print
STDERR
"
[-s <switchinfo>] <node_id> mac IP key_uid key
\n
";
print
STDERR
"
management_iface -r <node_id>
\n
";
print
STDERR
"
management_iface -i <node_id>
\n
";
...
...
@@ -48,12 +48,13 @@ sub usage()
print
STDERR
"
-a key SSH key auth; provide login and key path.
\n
";
print
STDERR
"
-c cable Cable ID
\n
";
print
STDERR
"
-l len Cable length
\n
";
print
STDERR
"
-T info Optional tipline info; server[,tipname]
\n
";
print
STDERR
"
-r Remove management interface from DB.
\n
";
print
STDERR
"
-i Display management interface from DB.
\n
";
print
STDERR
"
-n Do not restart daemons after changing DB.
\n
";
exit
(
-
1
);
}
my
$optlist
=
"
ht:a:rs:nic:l:
";
my
$optlist
=
"
ht:a:rs:nic:l:
T:
";
my
$debug
=
0
;
my
$remove
=
0
;
my
$info
=
0
;
...
...
@@ -63,6 +64,7 @@ my $type;
my
$cable
;
my
$cablelen
;
my
$switchinfo
;
my
$tipinfo
;
# Protos
sub
fatal
($);
...
...
@@ -134,6 +136,9 @@ if (defined($options{'n'})) {
if
(
defined
(
$options
{'
s
'}))
{
$switchinfo
=
$options
{'
s
'};
}
if
(
defined
(
$options
{'
T
'}))
{
$tipinfo
=
$options
{'
T
'};
}
if
(
defined
(
$options
{'
t
'}))
{
$type
=
$options
{'
t
'};
usage
()
...
...
@@ -261,6 +266,17 @@ $node->AddOutlet($type, 0,
"
key
"
=>
$ARGV
[
1
]})
==
0
or
fatal
("
Could not add outlet records
");
#
# Optional tipline.
#
if
(
defined
(
$tipinfo
))
{
my
(
$server
,
$tipname
)
=
split
("
,
",
$tipinfo
);
$tipname
=
$node_id
if
(
!
defined
(
$tipname
));
DBQueryFatal
("
replace into tiplines (tipname, node_id, server) values
"
.
"
('
$tipname
', '
$node_id
', '
$server
')
");
}
#
# Add the interface, if not there.
#
...
...
Write
Preview
Supports
Markdown
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