Skip to content

Instantly share code, notes, and snippets.

@seansullivan
Created August 23, 2010 18:57
Show Gist options
  • Save seansullivan/546078 to your computer and use it in GitHub Desktop.
Save seansullivan/546078 to your computer and use it in GitHub Desktop.
#!/bin/bash
declare -A hosts
hosts[site1]=200
hosts[site2]=201
default=${hosts[site1]}
if [ $1 ]
then
port=${hosts[$1]}
else
port=$default
fi
ssh server -p 22 -N -R *:199/localhost/$port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment