summaryrefslogtreecommitdiff
path: root/prepare-connect
diff options
context:
space:
mode:
Diffstat (limited to 'prepare-connect')
-rwxr-xr-xprepare-connect34
1 files changed, 0 insertions, 34 deletions
diff --git a/prepare-connect b/prepare-connect
deleted file mode 100755
index a7e8c32..0000000
--- a/prepare-connect
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-if [ -z "$1" ]; then
- echo "Usage: $0 <comment>" 1>&2
- exit 1
-fi
-
-comment=$1
-count=`ls ~/ra/ra-*-$comment-*.tar.gz 2>/dev/null | wc -l`
-if [ $count -gt 1 ]; then
- echo "More than 1 file from $comment in ~/ra. Leave only one file." 1>&2
- ls ~/ra/ra-*-$comment-*.tar.gz
- exit 1
-fi
-if [ $count -eq 0 ]; then
- echo "No files with name $comment in ~/ra." 1>&2
- ls ~/ra/ra-*-$comment-*.tar.gz
- exit 1
-fi
-file=`ls ~/ra/ra-*-$comment-*.tar.gz`
-port=`echo $file | sed 's/.*ra-\([^-]\+\)-.*/\1/'`
-keyfile=`echo $file | sed 's/.tar.gz$/-key/'`
-tar xzf $file -O key > $keyfile
-chmod 600 $keyfile
-perl -e '$host="'ra-$comment'"; $/=undef; $_=<>; s/^Host\s+(${host}$).*?((?=^Host)|\s*\Z)//gsm; print' ~/.ssh/config > ~/.ssh/config.new
-cat >> ~/.ssh/config.new <<EOF
-Host ra-$comment
- HostName localhost
- User support
- Port $port
- IdentityFile $keyfile
- ForwardX11 no
-EOF
-mv -f ~/.ssh/config.new ~/.ssh/config