From: yomguy Date: Wed, 17 Jul 2013 21:38:15 +0000 (+0200) Subject: add if-up scripts (reverse ssh, telecaster rsync) X-Git-Tag: 1.0~7^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=d551885651a94e2f3de9b8684600b6138bc9de66;p=telecaster-server.git add if-up scripts (reverse ssh, telecaster rsync) --- diff --git a/tcserver/conf/etc/network/if-up.d/reverse_ssh_tunnel b/tcserver/conf/etc/network/if-up.d/reverse_ssh_tunnel new file mode 100755 index 0000000..a3118cf --- /dev/null +++ b/tcserver/conf/etc/network/if-up.d/reverse_ssh_tunnel @@ -0,0 +1,29 @@ +#!/bin/sh +# ------------------------------ +# autossh reverse tunnel on boot +# ------------------------------ +# See autossh and google for reverse ssh tunnels to see how this works + +# When this script runs it will allow you to ssh into this machine even if it is behind a firewall or has a NAT'd IP address. +# From any ssh capable machine you just type ssh -p $PORT_MIDDLEMAN_WILL_LISTEN_ON localusername@middleman + +# This is the username on your local server who has public key authentication setup at the middleman +USER_TO_SSH_IN_AS=telecaster + +# This is the username and hostname/IP address for the middleman (internet accessible server) +MIDDLEMAN_SERVER_AND_USERNAME=telecaster@parisson.com + +# The following two numbers can be whatever you want, but need to be unique if you have multiple reverse ssh tunnels +# Port that the middleman will listen on (use this value as the -p argument when sshing) +PORT_MIDDLEMAN_WILL_LISTEN_ON=22012 + +# Connection monitoring port, don't need to know this one +AUTOSSH_PORT=27554 + +# Ensures that autossh keeps trying to connect +AUTOSSH_GATETIME=0 + +export AUTOSSH_PORT AUTOSSH_GATETIME + +su -c "autossh -f -N -R *:${PORT_MIDDLEMAN_WILL_LISTEN_ON}:localhost:22 ${MIDDLEMAN_SERVER_AND_USERNAME} -oLogLevel=error -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no" $USER_TO_SSH_IN_AS + diff --git a/tcserver/conf/etc/network/if-up.d/telecaster-rsync b/tcserver/conf/etc/network/if-up.d/telecaster-rsync new file mode 100755 index 0000000..59f5047 --- /dev/null +++ b/tcserver/conf/etc/network/if-up.d/telecaster-rsync @@ -0,0 +1,4 @@ +#!/bin/sh + +/usr/local/lib/telecaster/instance/manage.py teleforma-import-conferences Pre-Barreau /var/log/telecaster/import.log +