Last active
August 29, 2015 14:19
-
-
Save msukmanowsky/ba9d09fcee74de96bc24 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
# Hitting CTRL-C kills the Django server as well as all tunnels that were created | |
TUNNEL_PIDS=() | |
function kill_tunnels() { | |
for tunnel_pid in "${TUNNEL_PIDS[@]}" | |
do | |
kill $tunnel_pid | |
done | |
} | |
trap kill_tunnels EXIT | |
ssh -nNL 27017:localhost:27017 [email protected] & | |
TUNNEL_PIDS+=($!) | |
echo "MongoDB tunnel started." | |
ssh -nNL 5432:localhost:5432 [email protected] & | |
TUNNEL_PIDS+=($!) | |
echo "PostgreSQL tunnel started." | |
# Start Django server | |
python manage.py runserver 0.0.0.0:5000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment