Skip to content

Instantly share code, notes, and snippets.

@hellekin
Last active August 29, 2015 14:07
Show Gist options
  • Save hellekin/37ab0cca28076826b0df to your computer and use it in GitHub Desktop.
Save hellekin/37ab0cca28076826b0df to your computer and use it in GitHub Desktop.
#!/bin/sh
host=dowse.saliat.gnu
port=28332
twister_status=`ss -lt | awk '/127.0.0.1:'$port'/ { print "already running"; }'`
if [ "$twister_status" != "already running" ] ; then
echo -n "Opening tunnel to Twister... "
ssh -Nf -L $port:localhost:$port $host &&\
echo "Done." || echo "Failed."
else
echo "Twister tunnel $twister_status on port $port."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment