Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HOST = # masked
- SOURCE_PORT = 5672
- DESTINATION_PORT = 5672
- USERNAME = ifesdjeen
- createTunnel() {
- /usr/bin/ssh -f -N -L$SOURCE_PORT:$HOST:$DESTINATION_PORT -L19922:HOST:22 ifesdjeen@$HOST
- if [[ $? -eq 0 ]]; then
- echo Tunnel to $HOST created successfully
- else
- echo An error occurred creating a tunnel to $HOST RC was $?
- fi
- }
- /usr/bin/ssh -p 19922 $USERNAME@localhost ls
- if [[ $? -ne 0 ]]; then
- echo Creating new tunnel connection
- createTunnel
Add Comment
Please, Sign In to add comment