Skip to content

Instantly share code, notes, and snippets.

@Klowner
Created May 23, 2017 17:01
Show Gist options
  • Save Klowner/636bb441a491f71f674f183d5755fc62 to your computer and use it in GitHub Desktop.
Save Klowner/636bb441a491f71f674f183d5755fc62 to your computer and use it in GitHub Desktop.
autossh connection with openrc
#!/sbin/openrc-run
name=$RC_SVCNAME
command="/usr/bin/autossh"
pidfile="/run/${RC_SVCNAME}.pid"
AUTOSSH_LOGFILE="${AUTOSSH_LOGFILE:-/var/log/${RC_SVCNAME}.log}"
start_stop_daemon_args="-e AUTOSSH_PIDFILE=\"${pidfile}\" -e AUTOSSH_LOGFILE=\"${AUTOSSH_LOGFILE}\""
command_args="-M 10984 -N -f -o 'PubkeyAuthentication=yes' -o 'PasswordAuthentication=no' \
-i /root/.ssh/id_rsa -R 6666:localhost:22 middleman@middleman"
depend() {
need networking
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment