add sshpiperd example
This commit is contained in:
parent
cd3b19a914
commit
76ae58a84e
4 changed files with 35 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -22,3 +22,4 @@ _testmain.go
|
|||
*.exe
|
||||
*.test
|
||||
*.prof
|
||||
sshpiperd/example/sshpiperd_key*
|
||||
|
|
|
|||
32
sshpiperd/example/showme.sh
Executable file
32
sshpiperd/example/showme.sh
Executable 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
|
||||
1
sshpiperd/example/workingdir/github/sshpiper_upstream
Normal file
1
sshpiperd/example/workingdir/github/sshpiper_upstream
Normal file
|
|
@ -0,0 +1 @@
|
|||
github.com:22
|
||||
1
sshpiperd/example/workingdir/linode/sshpiper_upstream
Normal file
1
sshpiperd/example/workingdir/linode/sshpiper_upstream
Normal file
|
|
@ -0,0 +1 @@
|
|||
lish-atlanta.linode.com:22
|
||||
Loading…
Add table
Add a link
Reference in a new issue