Indent
This commit is contained in:
parent
0d5cf8f506
commit
8448282afa
@ -11,13 +11,13 @@ function showHelp() {
|
|||||||
#echo " stop profile|port target|tmpFile"
|
#echo " stop profile|port target|tmpFile"
|
||||||
echo "proxy:"
|
echo "proxy:"
|
||||||
echo " profile Name of the profile (~/.config/ssh-proxy/*)"
|
echo " profile Name of the profile (~/.config/ssh-proxy/*)"
|
||||||
echo " port Proxy local port"
|
echo " port Proxy local port"
|
||||||
echo " target Proxy target [user@]server[:port]"
|
echo " target Proxy target [user@]server[:port]"
|
||||||
#echo " tmpFile Proxy instance pid file (/tmp/ssh-proxy/*)"
|
#echo " tmpFile Proxy instance pid file (/tmp/ssh-proxy/*)"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "${1}" == "" ]; then
|
if [ "${1}" == "" ]; then
|
||||||
showHelp
|
showHelp
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
case ${1} in
|
case ${1} in
|
||||||
@ -32,8 +32,8 @@ case ${1} in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if [ "${2}" == "" ]; then
|
if [ "${2}" == "" ]; then
|
||||||
showHelp
|
showHelp
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LOCAL_PORT=0
|
LOCAL_PORT=0
|
||||||
@ -104,10 +104,10 @@ function startProxy() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Start proxy ${LOCAL_PORT}"
|
echo "Start proxy ${LOCAL_PORT}"
|
||||||
if ! ssh -fND 127.0.0.1:"${LOCAL_PORT}" "${PROXY_USER}"@"${PROXY_SERVER}" -p "${PROXY_SERVER_PORT}"; then
|
if ! ssh -fND 127.0.0.1:"${LOCAL_PORT}" "${PROXY_USER}"@"${PROXY_SERVER}" -p "${PROXY_SERVER_PORT}"; then
|
||||||
echo "Error: Proxy start error"
|
echo "Error: Proxy start error"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
PID=$(lsof -i -P | grep ":${LOCAL_PORT} (LISTEN)" | awk -F ' ' '{print $2}')
|
PID=$(lsof -i -P | grep ":${LOCAL_PORT} (LISTEN)" | awk -F ' ' '{print $2}')
|
||||||
if [ "${PID}" == "" ]; then
|
if [ "${PID}" == "" ]; then
|
||||||
echo "Error: No PID found"
|
echo "Error: No PID found"
|
||||||
@ -137,7 +137,7 @@ function stopProxy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case ${1} in
|
case ${1} in
|
||||||
"start") startProxy;;
|
"start") startProxy;;
|
||||||
"stop") stopProxy;;
|
"stop") stopProxy;;
|
||||||
*) exit 1;;
|
*) exit 1;;
|
||||||
esac
|
esac
|
||||||
|
Reference in New Issue
Block a user