Skip to content

Instantly share code, notes, and snippets.

@farhaven
Created February 20, 2010 13:28
Show Gist options
  • Save farhaven/309679 to your computer and use it in GitHub Desktop.
Save farhaven/309679 to your computer and use it in GitHub Desktop.
#!/bin/bash
TUNNEL="ssh -NL3334:localhost:3334 [email protected]"
CMD=
if [ ! x$DISPLAY == x ]; then
CMD="urxvtc -name urxvt.irssi -e"
fi
if [ `screen -ls | grep -c Dead` -gt 0 ]; then
screen -wipe
fi
if [ `screen -ls | grep -c irssi` -gt 0 ]; then
$CMD screen -raAd irssi
else
nohup sh -c "while true; do $TUNNEL; sleep 2; done" &
sleep 2
$CMD screen -S irssi -U irssi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment