HTPCGuides / pia-port-forwarding-scripts

PIA Port forwarding scripts
http://www.htpcguides.com/
9 stars 5 forks source link

Update to new PIA port forward API #4

Closed inspector71 closed 1 year ago

inspector71 commented 5 years ago

Please note: the full script has NOT been TESTED (see footnote).

PIA changed their Port Forwarding port assignment API: https://www.privateinternetaccess.com/archive/forum/discussion/23431

These changes should allow this script to work with the new API ... if, and only when, the script is called within 120 seconds of connecting to PIA. Thus, it is only suitable to run as an 'up' script.

Changes include several helpful-for-testing echo statements that will either need to be commented out when run as an 'up' script or converted to logging output.

Best of luck!

Footnote: script has not yet been tested as an 'up' script or in it's entirety as I am not running a split VPN and have not yet pieced all of this together. Am currently running the first 'half' of the task, PIA port acquisition, manually in a separate file. Then the Transmission second half task separately again. No reason this should not work in it's entirety as a single script though (unless there's a minor typo, scope bug or two, of course).

Swarsel commented 5 years ago

Would it not be better to run this as a client-connect script instead of as up? Or will it be too slow that way?