Skip to content

Instantly share code, notes, and snippets.

@andrewebdev
Created April 13, 2016 15:03
Show Gist options
  • Save andrewebdev/7dd5e7dd91f7597c0cbf4bfeafc19404 to your computer and use it in GitHub Desktop.
Save andrewebdev/7dd5e7dd91f7597c0cbf4bfeafc19404 to your computer and use it in GitHub Desktop.
Uses sockets to open connections to bitbucket
#!/bin/bash
case "$1" in
'start') echo "Starting SSH tunnel ..."
ssh -fTN git@bitbucket.org
;;
'check') echo "Checking if tunnel is active ..."
ssh -O check git@bitbucket.org
;;
'stop') echo "Stopping tunnel ..."
ssh -O exit git@bitbucket.org
;;
*) echo "Usage: start|stop|check" ;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment