#!/bin/sh # i hate lag, but i dident want to expose any ports on my server # so i created this little script to tunnel ports via ssh and # handle it all transperently, just adapt to your own host and # connect your irssi-proxy to what ever ports you wish # released under gpl, see gpl.txt # copyright (c) 2004 Mads Jørgensen # script to ssh tunnel two ports from gragh to localhost and run # irssi with proxy on them # efnet is port 2000, here 20000 # quakenet is port 2001, here 20001 # what file to store the ssh tunnel pid in TUNNEL_PID=~/.irssi_ssh_tunnel.pid # create the ssh tunnel if [ ! -f $TUNNEL_PID ]; then ssh -T -N -L 20000:localhost:2000 -L 20001:localhost:2001 yourhost.tdl & # save pid echo $! > $TUNNEL_PID else echo "Tunnel allready up - not starting" fi # wait for tunnel to come up echo "Waiting 10 seconds for tunnel to start" sleep 10 # start irssi irssi # kill tunnel and remove pid file echo "Shuting down tunnel .." kill `cat $TUNNEL_PID` wait `cat $TUNNEL_PID` echo ". done" rm -f $TUNNEL_PID