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
21e6754b
Commit
21e6754b
authored
May 20, 2014
by
Leigh B Stoller
Browse files
Fix regex for -s option, so that you can do interconnect-utahddc:eth0.
parent
f2e9e634
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/snmpit_test/portstats.in
View file @
21e6754b
#!/usr/bin/perl -T
#!/usr/bin/perl -T
#
#
# Copyright (c) 2000-201
3
University of Utah and the Flux Group.
# Copyright (c) 2000-201
4
University of Utah and the Flux Group.
#
#
# {{{EMULAB-LICENSE
# {{{EMULAB-LICENSE
#
#
...
@@ -148,7 +148,7 @@ if (!$opt{p} && !$opt{s}) {
...
@@ -148,7 +148,7 @@ if (!$opt{p} && !$opt{s}) {
my
@passedPorts
=
();
my
@passedPorts
=
();
foreach
my
$arg
(
@ARGV
)
{
foreach
my
$arg
(
@ARGV
)
{
if
(
$opt
{
s}) {
if
(
$opt
{
s}) {
if ($arg =~ /^([-\w\.\/]+)$/) {
if ($arg =~ /^([-\w\.\/
:
]+)$/) {
$arg = $1;
$arg = $1;
}
}
else {
else {
...
@@ -228,7 +228,14 @@ if ($opt{s}) {
...
@@ -228,7 +228,14 @@ if ($opt{s}) {
foreach my $port (@passedPorts) {
foreach my $port (@passedPorts) {
if ($port =~ /^[^.]+\.\d+\/\d+$/) {
if ($port =~ /^[^.]+\.\d+\/\d+$/) {
push @ports, convertPortFromString($port);
push @ports, convertPortFromString($port);
} else {
}
elsif ($port =~ /^[^:]+:\d+\.\d+$/) {
push @ports, convertPortFromString($port);
}
elsif
(
$port
=~
/^[^:]+:\w+$/
)
{
push
@ports
,
convertPortFromString
(
$port
);
}
else
{
print
"
'
$port
' not in correct switch.port syntax, ignoring
\n
";
print
"
'
$port
' not in correct switch.port syntax, ignoring
\n
";
}
}
}
}
...
...
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