Last active
August 29, 2015 14:07
-
-
Save hellekin/37ab0cca28076826b0df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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