aboutsummaryrefslogtreecommitdiff
path: root/rex
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2015-08-17 17:14:26 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2015-08-17 17:14:26 +0300
commitc66332347d43bcc120412a44b831b021b6789b6f (patch)
tree36ace119dd69d156a7f537215547d881c146307f /rex
parentde82f2847f37bfe5a1d2ce32d2e129322c57fc49 (diff)
downloadrex-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-xrex17
1 files changed, 11 insertions, 6 deletions
diff --git a/rex b/rex
index 0c85e13..ccfbb5a 100755
--- a/rex
+++ b/rex
@@ -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
+ }
+ }
+ }
}
}

Return to:

Send suggestions and report system problems to the System administrator.