projects
/
sysadmin-cookbook
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
159d029
)
cook over ssh connection (add host as last argument)
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 17 May 2009 15:33:23 +0000
(15:33 +0000)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 17 May 2009 15:33:23 +0000
(15:33 +0000)
git-svn-id: svn://svn.rot13.org/sysadmin-cookbook@83
191e9f34
-6774-4a6d-acfc-
7664dacd4a2a
bin/cook.sh
patch
|
blob
|
history
diff --git
a/bin/cook.sh
b/bin/cook.sh
index
ab1c665
..
c224310
100755
(executable)
--- a/
bin/cook.sh
+++ b/
bin/cook.sh
@@
-6,5
+6,10
@@
test -e $1 || ( echo "usage: $0 recepises/something"; exit )
cat $1
-grep '[a-z]*@[a-z]*:[^$#]*[$#]' $1 | cut -d\# -f 2 | xargs -i sh -x -c "{}"
+ssh=''
+if [ ! -z $2 ] ; then
+ ssh="ssh $2"
+fi
+
+grep '[a-z]*@[a-z]*:[^$#]*[$#]' $1 | cut -d\# -f 2 | $ssh xargs -i sh -x -c "{}"