-
-
Save indolering/5333872 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
set user to "PIA-USERNAME" | |
set pass to "PIA-PASSWORD" | |
set macAddHash to do shell script "/sbin/ifconfig en0 | /usr/bin/awk '/ether / {print $2}' | /usr/bin/tr -d ':' | md5 " | |
set vpn_ip to do shell script "ifconfig tun0 | grep inet | awk '{print $2}'" | |
set vpn_port to do shell script "curl -d \"user=" & user & "&pass=" & pass & "&client_id=" & macAddHash & "&local_ip=" & vpn_ip & "\" https://www.privateinternetaccess.com/vpninfo/port_forward_assignment | grep -oE \"[0-9]+\"" | |
do shell script "defaults write org.m0k.transmission BindPort " & vpn_port & "" | |
do shell script "defaults delete org.m0k.transmission BindPort" | |
do shell script "defaults write org.m0k.transmission BindPort " & vpn_port & "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment