Skip to content

Instantly share code, notes, and snippets.

@icgood
Last active August 29, 2015 14:06
Show Gist options
  • Save icgood/6eb6be68932e7a25e5d9 to your computer and use it in GitHub Desktop.
Save icgood/6eb6be68932e7a25e5d9 to your computer and use it in GitHub Desktop.
Maintains an always-open SOCKS proxy over SSH.
#!/bin/bash
HOST="$1"
if [ "$HOST" = "" ]; then
echo "usage: $0 <ssh-host>"
exit 1
elif [ "$HOST" = "--reconnect" ]; then
pkill -USR1 autossh
exit 0
fi
autossh -f -M 7071 -N -D localhost:7070 $HOST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment