Rev 747: allow remote variable expansion in onnode, so you can use wildcards that expand on the remote nodes in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Wed Jan 9 04:04:56 GMT 2008


------------------------------------------------------------
revno: 747
revision-id:tridge at samba.org-20080109040456-25b9bq0wqqvukn4u
parent: tridge at samba.org-20080108232220-ym44ep4y456pg9hr
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge.stable
timestamp: Wed 2008-01-09 15:04:56 +1100
message:
  allow remote variable expansion in onnode, so you can use wildcards that expand on the remote nodes
modified:
  tools/onnode.rsh               onnode.rsh-20070530010004-83j66tszzvsimcn2-1
  tools/onnode.ssh               onnode.ssh-20070530010004-83j66tszzvsimcn2-3
=== modified file 'tools/onnode.rsh'
--- a/tools/onnode.rsh	2008-01-07 03:31:13 +0000
+++ b/tools/onnode.rsh	2008-01-09 04:04:56 +0000
@@ -10,7 +10,7 @@
 
 NODE="$1"
 shift
-SCRIPT="$*"
+SCRIPT="$@"
 
 NODES=/etc/ctdb/nodes
 
@@ -21,9 +21,9 @@
     for a in `egrep '^[[:alnum:]]' $NODES`; do
 	echo; echo ">> NODE: $a <<"
 	if [ -f "$SCRIPT" ]; then
-	    rsh $a at -f $SCRIPT now
+	    rsh $a at -f "$SCRIPT" now
 	else
-	    rsh $a $SCRIPT
+	    rsh $a "$SCRIPT"
 	fi
     done
     exit 0
@@ -38,7 +38,7 @@
 a=`egrep '^[[:alnum:]]' $NODES | head -$NODEPLUSONE | tail -1`
 
 if [ -f "$SCRIPT" ]; then
-    exec rsh $a at -f $SCRIPT now
+    exec rsh $a at -f "$SCRIPT" now
 else
-    exec rsh $a $SCRIPT
+    exec rsh $a "$SCRIPT"
 fi

=== modified file 'tools/onnode.ssh'
--- a/tools/onnode.ssh	2008-01-07 03:31:13 +0000
+++ b/tools/onnode.ssh	2008-01-09 04:04:56 +0000
@@ -10,7 +10,7 @@
 
 NODE="$1"
 shift
-SCRIPT="$*"
+SCRIPT="$@"
 
 NODES=/etc/ctdb/nodes
 
@@ -21,9 +21,9 @@
     for a in `egrep '^[[:alnum:]]' $NODES`; do
 	echo; echo ">> NODE: $a <<"
 	if [ -f "$SCRIPT" ]; then
-	    ssh -n $a at -f $SCRIPT now
+	    ssh -n $a at -f "$SCRIPT" now
 	else
-	    ssh -n $a $SCRIPT
+	    ssh -n $a "$SCRIPT"
 	fi
     done
     exit 0
@@ -38,7 +38,7 @@
 a=`egrep '^[[:alnum:]]' $NODES | head -$NODEPLUSONE | tail -1`
 
 if [ -f "$SCRIPT" ]; then
-    exec ssh -n $a at -f $SCRIPT now
+    exec ssh -n $a at -f "$SCRIPT" now
 else
-    exec ssh -n $a $SCRIPT
+    exec ssh -n $a "$SCRIPT"
 fi



More information about the samba-cvs mailing list