Remove debug message and wrap more variables.
This commit is contained in:
parent
e30d950f88
commit
9083bfc5ad
1 changed files with 3 additions and 5 deletions
|
@ -60,14 +60,12 @@ disconnect() {
|
|||
# $2 - target port
|
||||
port_forward() {
|
||||
ACTIVE_HOST=$(cat $CONNECTION_CACHE)
|
||||
if [ -z $ACTIVE_HOST ] || [ $ACTIVE_HOST != "$1:$2" ]
|
||||
if [ -z "${ACTIVE_HOST}" ] || [ "${ACTIVE_HOST}" != "$1:$2" ]
|
||||
then
|
||||
if [ ! -z $ACTIVE_HOST ]
|
||||
if [ -n "${ACTIVE_HOST}" ]
|
||||
then
|
||||
ssh -O cancel -L 6033:$ACTIVE_HOST -S $HOME/.ssh/controlmasters/%r@%h:%p ${SQL_PROXY_HOST} q
|
||||
ssh -O cancel -L 6033:${ACTIVE_HOST} -S ${HOME}/.ssh/controlmasters/%r@%h:%p ${SQL_PROXY_HOST} q
|
||||
fi
|
||||
echo $ACTIVE_HOST
|
||||
echo $1 $2
|
||||
ssh -O forward -L 6033:$1:$2 -S ${HOME}/.ssh/controlmasters/%r@%h:%p ${SQL_PROXY_HOST}
|
||||
fi
|
||||
echo "$1:$2" > "${CONNECTION_CACHE}"
|
||||
|
|
Loading…
Reference in a new issue