Commit 08e87b81 authored by Shashi Guruprasad's avatar Shashi Guruprasad

fix for change in output format of 'tmcc hostnames'

parent cd97db56
...@@ -6,10 +6,12 @@ proc getipaddr {name} { ...@@ -6,10 +6,12 @@ proc getipaddr {name} {
set hostnamelist [split [exec tmcc hostnames] "\n"] set hostnamelist [split [exec tmcc hostnames] "\n"]
foreach hostname $hostnamelist { foreach hostname $hostnamelist {
scan $hostname "NAME=%s LINK=%u IP=%s " hname linknum ip scan $hostname "NAME=%s IP=%s ALIASES=\'%s\'" hname ip aliases
set hnametomatch "$hname-$linknum" set aliaslist [split $aliases " "]
if { $hnametomatch == $name } { foreach alias $aliaslist {
return $ip if { $alias == $name } {
return $ip
}
} }
} }
puts stderr "NSE: Could not find ipaddress for $name" puts stderr "NSE: Could not find ipaddress for $name"
......
...@@ -6,10 +6,12 @@ proc getipaddr {name} { ...@@ -6,10 +6,12 @@ proc getipaddr {name} {
set hostnamelist [split [exec tmcc hostnames] "\n"] set hostnamelist [split [exec tmcc hostnames] "\n"]
foreach hostname $hostnamelist { foreach hostname $hostnamelist {
scan $hostname "NAME=%s LINK=%u IP=%s " hname linknum ip scan $hostname "NAME=%s IP=%s ALIASES=\'%s\'" hname ip aliases
set hnametomatch "$hname-$linknum" set aliaslist [split $aliases " "]
if { $hnametomatch == $name } { foreach alias $aliaslist {
return $ip if { $alias == $name } {
return $ip
}
} }
} }
puts stderr "NSE: Could not find ipaddress for $name" puts stderr "NSE: Could not find ipaddress for $name"
......
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