Added some scripts
This commit is contained in:
parent
b70af69038
commit
a557bb9c55
5 changed files with 105 additions and 18 deletions
33
Bin/tunnel.sh
Executable file
33
Bin/tunnel.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#! /bin/bash
|
||||
|
||||
LOCAL_PORT=6660
|
||||
CLIENT=127.0.0.1
|
||||
REMOTE="-"
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--local-port=*)
|
||||
LOCAL_PORT="${1#*=}"
|
||||
;;
|
||||
--remote=*)
|
||||
REMOTE="${1#*=}"
|
||||
;;
|
||||
--client=*)
|
||||
CLIENT="${1#*=}"
|
||||
;;
|
||||
*)
|
||||
printf "Invalid parameter $1"
|
||||
exit 1
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "${REMOTE}" = "-" ] ; then
|
||||
printf "Invalid value for --remote="
|
||||
exit 1
|
||||
fi
|
||||
|
||||
REMOTE_SERVER=`echo ${REMOTE}|cut -d: -f1`
|
||||
REMOTE_PORT=`echo ${REMOTE}|cut -d: -f2`
|
||||
|
||||
ssh -L ${LOCAL_PORT}:${CLIENT}:${REMOTE_PORT} ${REMOTE_SERVER}
|
Loading…
Add table
Add a link
Reference in a new issue