Skip to content

Instantly share code, notes, and snippets.

@simonmorley
Created August 7, 2014 17:59
Show Gist options
  • Save simonmorley/481c6bc07fa7aadcf8c8 to your computer and use it in GitHub Desktop.
Save simonmorley/481c6bc07fa7aadcf8c8 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
if [ "X$SSH_AUTH_SOCK" = "X" ]; then
eval `ssh-agent -s`
ssh-add $HOME/.ssh/id_rsa
fi
HOST=
REDIS_SLAVE_PORT=6000
AUTOSSH_POLL=600
AUTOSSH_PORT=0
AUTOSSH_GATETIME=30
AUTOSSH_LOGFILE=/tmp/auto.log
AUTOSSH_DEBUG=yes
AUTOSSH_PATH=/usr/local/bin/ssh
export AUTOSSH_POLL AUTOSSH_LOGFILE AUTOSSH_DEBUG AUTOSSH_PATH AUTOSSH_GATETIME AUTOSSH_PORT
autossh -2 -fN -M ${AUTOSSH_PORT} -C -L ${REDIS_SLAVE_PORT}:localhost:6379 HOST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment