diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-08-17 17:14:26 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-08-17 17:14:26 +0300 |
commit | c66332347d43bcc120412a44b831b021b6789b6f (patch) | |
tree | 36ace119dd69d156a7f537215547d881c146307f /rex | |
parent | de82f2847f37bfe5a1d2ce32d2e129322c57fc49 (diff) | |
download | rex-c66332347d43bcc120412a44b831b021b6789b6f.tar.gz rex-c66332347d43bcc120412a44b831b021b6789b6f.tar.bz2 |
Bugfixes
* rex (runcmd): Add missing sigil.
Fix -X functionality in case when resolve returns multiple
names/ips.
Diffstat (limited to 'rex')
-rwxr-xr-x | rex | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -1073,7 +1073,7 @@ proc runcmd {hosts command} { "*assword:" { set sid $expect_out(spawn_id) set host $sidinfo($sid,host) - if {sidinfo($sid,state) != "PASS_SENT"} { + if {$sidinfo($sid,state) != "PASS_SENT"} { closeproc $sid } else { send -i $expect_out(spawn_id) "[hostpass $host]\r" @@ -1498,11 +1498,16 @@ if {![info exists config(hosts)] || [llength $config(hosts)] == 0} { if {[info exists config(exclude_hosts)] && [llength $config(exclude_hosts)] > 0} { foreach h $config(exclude_hosts) { set x [lsearch -all -inline -not -exact $config(hosts) $h] - if {[llength $x] == [llength $config(hosts)]} { - set r [::pmres::resolve $h] - set x [lsearch -all -inline -not -exact $config(hosts) $r] - } - set config(hosts) $x + if {[llength $x] < [llength $config(hosts)]} { + set config(hosts) $x + } else { + foreach r [::pmres::resolve $h] { + set x [lsearch -all -inline -not -exact $config(hosts) $r] + if {[llength $x] < [llength $config(hosts)]} { + set config(hosts) $x + } + } + } } } |