Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- createTunnel() {
- /usr/bin/ssh -N -R 2222:localhost:22 [email protected]
- if [[ $? -eq 0 ]]; then
- echo successful tunnel to mniip.com!
- else
- echo exit code $? - error tunnelling to mniip.com
- fi
- }
- /bin/pidof ssh
- if [[ $? -ne 0 ]]; then
- echo tunnel was down, reopening
- createTunnel
- fi
Advertisement
Add Comment
Please, Sign In to add comment