Created
June 21, 2014 16:07
-
-
Save schrobby/1c6df5a7ce4b3ff386df to your computer and use it in GitHub Desktop.
Uses PIA's rudimentary API to forward a port and return it
This file contains hidden or 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/bash | |
USER=`head -n 1 userdata.file` | |
PASS=`tail -n 1 userdata.file` | |
DEVICE=`/sbin/ifconfig | grep -o "tun[0-9]"` | |
LOCAL_IP=`/sbin/ifconfig $DEVICE | grep -Po "(?<=addr.)[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*"` | |
curl -s -d "user=$USER&pass=$PASS&client_id=$(cat pia_client_id)&local_ip=$LOCAL_IP" https://www.privateinternetaccess.com/vpninfo/port_forward_assignment | grep -Po "[0-9]*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment