add sshpiperd example

This commit is contained in:
tgic 2014-12-08 12:10:00 +08:00 committed by Boshi Lian
parent cd3b19a914
commit 76ae58a84e
4 changed files with 35 additions and 0 deletions

1
.gitignore vendored
View file

@ -22,3 +22,4 @@ _testmain.go
*.exe
*.test
*.prof
sshpiperd/example/sshpiperd_key*

32
sshpiperd/example/showme.sh Executable file
View file

@ -0,0 +1,32 @@
#!/bin/bash
if [ -z $GOPATH ]; then
echo "set go path first"
exit 1
fi
echo "Using go path $GOPATH"
if [ ! -f $GOPATH/bin/sshpiperd ];then
go get github.com/tg123/sshpiper/sshpiperd
go install github.com/tg123/sshpiper/sshpiperd
fi
SSHPIPERD_BIN="$GOPATH/bin/sshpiperd"
BASEDIR="$GOPATH/src/github.com/tg123/sshpiper/sshpiperd/example"
if [ ! -f $BASEDIR/sshpiperd_key ];then
ssh-keygen -N '' -f $BASEDIR/sshpiperd_key
fi
for u in `find $BASEDIR/workingdir/ -name sshpiper_upstream`; do
upstream=`cat $u`
username=`dirname $u`
username=`basename $username`
echo "ssh 127.0.0.1 -p 2222 -l $username # connect to $upstream"
done
$SSHPIPERD_BIN -i $BASEDIR/sshpiperd_key -w $BASEDIR/workingdir

View file

@ -0,0 +1 @@
github.com:22

View file

@ -0,0 +1 @@
lish-atlanta.linode.com:22