Search the web
Sign In
New User? Sign Up
put-latex · LaTeX users group at Poznan UT
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
[put-latex-svn][pwesolek] r85 - trunk/distcomp/scripts   Message List  
Reply | Forward Message #382 of 404 |
Author: pwesolek
Date: Wed Dec 3 12:21:00 2008
New Revision: 85

Modified:
trunk/distcomp/scripts/rshknowhosts.sh
trunk/distcomp/scripts/rshlst.sh
trunk/distcomp/scripts/rshpar.sh
trunk/distcomp/scripts/rshseq.sh
Log:
Added option to specify SSH keyring to all commands (--ssh). The reason is that
sometimes you may want to be sure about hosts identifyi, e.g. when knocking to a
*different* SSH, running on Cygwin (dual boot labs). In such case, --ssh option
let you specify read-only known_hosts keyring (with exception of
rshknowhosts.sh, which is used to build such a keyring).


Modified: trunk/distcomp/scripts/rshknowhosts.sh
==============================================================================
--- trunk/distcomp/scripts/rshknowhosts.sh (original)
+++ trunk/distcomp/scripts/rshknowhosts.sh Wed Dec 3 12:21:00 2008
@@ -2,10 +2,18 @@

if [ $# -lt 1 ]; then
echo "Feeds SSH's known_hosts with a list of hosts. Usage:"
- echo "$0 hosts_file [username]"
+ echo "$0 [ --ssh known_hosts ] hosts_file [username]"
exit 1
fi

+if [ "$1" == "--ssh" ]; then
+ SSH_KNOWN_HOSTS_OPTS="-o UserKnownHostsFile=$2"
+ shift
+ shift
+else
+ SSH_KNOWN_HOSTS_OPTS=''
+fi
+
HOSTS=$1
shift

@@ -16,7 +24,7 @@
fi

# Don't wait too long for inaccessible hosts.
-SSH_OPTS="-o ConnectTimeout=2 -o BatchMode=yes -o StrictHostKeyChecking=no"
+SSH_OPTS="-o ConnectTimeout=2 -o BatchMode=yes -o StrictHostKeyChecking=no
$SSH_KNOWN_HOSTS_OPTS"

TMP=`mktemp -t -d`
sed -e 's/#.*//' -e '/^[ \t]*$/d' $HOSTS > $TMP/hosts

Modified: trunk/distcomp/scripts/rshlst.sh
==============================================================================
--- trunk/distcomp/scripts/rshlst.sh (original)
+++ trunk/distcomp/scripts/rshlst.sh Wed Dec 3 12:21:00 2008
@@ -2,10 +2,18 @@

if [ $# -lt 1 ]; then
echo "Lists SSH-accessible hosts. Usage:"
- echo "$0 hosts_file [username]"
+ echo "$0 [ --ssh known_hosts ] hosts_file [username]"
exit 1
fi

+if [ "$1" == "--ssh" ]; then
+ SSH_KNOWN_HOSTS_OPTS="-o UserKnownHostsFile=$2"
+ shift
+ shift
+else
+ SSH_KNOWN_HOSTS_OPTS=''
+fi
+
HOSTS=$1
shift

@@ -16,7 +24,7 @@
fi

# Don't wait too long for inaccessible hosts.
-SSH_OPTS="-o ConnectTimeout=2 -o BatchMode=yes"
+SSH_OPTS="-o ConnectTimeout=2 -o BatchMode=yes -o StrictHostKeyChecking=yes
$SSH_KNOWN_HOSTS_OPTS"

TMP=`mktemp -t -d`
sed -e 's/#.*//' -e '/^[ \t]*$/d' $HOSTS > $TMP/hosts

Modified: trunk/distcomp/scripts/rshpar.sh
==============================================================================
--- trunk/distcomp/scripts/rshpar.sh (original)
+++ trunk/distcomp/scripts/rshpar.sh Wed Dec 3 12:21:00 2008
@@ -2,7 +2,7 @@

if [ $# -lt 2 ]; then
echo "Executes the command in parallel. Usage:"
- echo "$0 [ -q | --quiet ] hosts_file remote_command"
+ echo "$0 [ -q | --quiet ] [ --ssh known_hosts ] hosts_file remote_command"
exit 1
fi

@@ -11,10 +11,18 @@
shift
fi

+if [ "$1" == "--ssh" ]; then
+ SSH_KNOWN_HOSTS_OPTS="-o StrictHostKeyChecking=yes -o UserKnownHostsFile=$2"
+ shift
+ shift
+else
+ SSH_KNOWN_HOSTS_OPTS=''
+fi
+
HOSTS=$1
shift

-SSH_OPTS="-o ConnectTimeout=2 -o BatchMode=yes"
+SSH_OPTS="-o ConnectTimeout=2 -o BatchMode=yes $SSH_KNOWN_HOSTS_OPTS"

TMP=`mktemp -t -d`
sed -e 's/#.*//' -e '/^[ \t]*$/d' $HOSTS > $TMP/hosts

Modified: trunk/distcomp/scripts/rshseq.sh
==============================================================================
--- trunk/distcomp/scripts/rshseq.sh (original)
+++ trunk/distcomp/scripts/rshseq.sh Wed Dec 3 12:21:00 2008
@@ -2,7 +2,7 @@

if [ $# -lt 2 ]; then
echo "Executes the command sequentially. Usage:"
- echo "$0 [ -q | --quiet ] hosts_file remote_command"
+ echo "$0 [ -q | --quiet ] [ --ssh known_hosts ] hosts_file remote_command"
exit 1
fi

@@ -11,10 +11,18 @@
shift
fi

+if [ "$1" == "--ssh" ]; then
+ SSH_KNOWN_HOSTS_OPTS="-o StrictHostKeyChecking=yes -o UserKnownHostsFile=$2"
+ shift
+ shift
+else
+ SSH_KNOWN_HOSTS_OPTS=''
+fi
+
HOSTS=$1
shift

-SSH_OPTS="-o ConnectTimeout=2 -o BatchMode=yes"
+SSH_OPTS="-o ConnectTimeout=2 -o BatchMode=yes $SSH_KNOWN_HOSTS_OPTS"

TMP=`mktemp -t -d`
sed -e 's/#.*//' -e '/^[ \t]*$/d' $HOSTS > $TMP/hosts



Wed Dec 3, 2008 11:20 am

dawid_weiss
Offline Offline
Send Email Send Email

Forward
Message #382 of 404 |
Expand Messages Author Sort by Date

Author: pwesolek Date: Wed Dec 3 12:21:00 2008 New Revision: 85 Modified: trunk/distcomp/scripts/rshknowhosts.sh trunk/distcomp/scripts/rshlst.sh ...
dawid.weiss@...
dawid_weiss
Offline Send Email
Dec 3, 2008
11:21 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help