Last active
December 22, 2015 10:19
-
-
Save jakebellacera/6457909 to your computer and use it in GitHub Desktop.
BrowserStack tunnel bash script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# BrowserStack Tunnel bash script | |
# By: Jake Bellacera (http://jakebellacera.com) | |
# | |
# Usage: | |
# browserstack | |
# browserstack start [opts=localhost,80,0] # starts a tunnel | |
TUNNEL_KEY="abcdefg12345" | |
TUNNEL_FILE="/path/to/BrowserStackTunnel.jar" | |
if [ -n "$1" ]; then | |
# start [domain] | |
# | |
# domain: (optional) the domain to forward | |
if [ "$1" == "start" ]; then | |
# Set the domain | |
if [ -n "$2" ]; then | |
OPTS="$2" | |
else | |
OPTS="localhost,80,0" | |
fi | |
echo "starting..." | |
eval "java -jar $TUNNEL_FILE $TUNNEL_KEY $OPTS" | |
# default method | |
# Returns an error | |
else | |
echo -en "\033[31m$1: unrecognized command\033[m\n" | |
printf "$UNRECOGNIZED_COMMAND_MSG" | |
fi | |
else | |
printf "$UNRECOGNIZED_COMMAND_MSG" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment