Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mytrile/eebd7b0e9837bf2a61fda6e8ae675c13 to your computer and use it in GitHub Desktop.
Save mytrile/eebd7b0e9837bf2a61fda6e8ae675c13 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