Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Automatically generated configuration
- daemon
- client
- dev tun11
- proto udp
- remote nl.privateinternetaccess.com 1198
- resolv-retry 30
- nobind
- persist-key
- persist-tun
- comp-lzo adaptive
- ncp-ciphers AES-128-GCM:AES-256-GCM:AES-128-CBC:AES-256-CBC
- cipher AES-128-CBC
- redirect-gateway def1
- verb 3
- script-security 2
- up updown.sh
- down updown.sh
- ca ca.crt
- status-version 2
- status status
- # Custom Configuration
- syslog [progname]
- persist-key
- persist-tun
- tls-client
- auth-user-pass /tmp/password.txt
- comp-lzo
- verb 3
- reneg-sec 0
- ipchange "/etc/openvpn/test.sh"
- script-security 3
- #!/opt/bin/bash
- #
- # Enable port forwarding when using Private Internet Access
- #
- # Usage:
- # ./port_forwarding.sh
- set -x
- exec 5>/etc/openvpn/mylog
- BASH_XTRACEFD="5"
- PS4='$LINENO: '
- TRANSUSER=me
- TRANSPASS=mypass
- TRANSHOST=192.168.1.251
- client_id_file="/etc/openvpn/pia_client_id"
- if [ ! -f "$client_id_file" ]; then
- if hash /opt/bin/shasum 2>/dev/null; then
- /usr/bin/head -n 100 /dev/urandom | /opt/bin/shasum -a 256 | tr -d " -" > "$client_id_file"
- elif hash /opt/bin/sha256sum 2>/dev/null; then
- /usr/bin/head -n 100 /dev/urandom | /opt/bin/sha256sum | tr -d " -" > "$client_id_file"
- else
- /bin/echo "Please install shasum or sha256sum, and make sure it is visible in your $PATH"
- exit 1
- fi
- fi
- client_id=`/bin/cat "$client_id_file"`
- json=`/opt/bin/curl "http://209.222.18.222:2000/?client_id=$client_id" 2>/dev/null`
- if [ "$json" == "" ]; then
- json='Port forwarding is already activated on this connection, has expired, or you are not connected to a PIA region that supports port forwarding'
- fi
- /bin/echo server returned message: $json
- #trim VPN forwarded port from JSON
- PORT=$(echo $json | /usr/bin/awk 'BEGIN{r=1;FS="[{}":]+"} /port/{r=0; print $3} END{exit r}')
- /bin/echo if successful port is:$PORT
- #change transmission port on the fly
- /opt/bin/transmission-remote $TRANSHOST --auth $TRANSUSER:$TRANSPASS -p "$PORT"
- /bin/echo your transmission details: $TRANSHOST $TRANSUSER $TRANSPASS
- + PS4='$LINENO: '
- 12: TRANSUSER=me
- 13: TRANSPASS=pass
- 14: TRANSHOST=192.168.1.251
- 16: client_id_file=/etc/openvpn/pia_client_id
- 17: '[' '!' -f /etc/openvpn/pia_client_id ']'
- 227: /bin/cat /etc/openvpn/pia_client_id
- 27: client_id=080db0a6e936918d405683447a78bf426273e9a1ea2ecce744722ac3241d4232
- 228: /opt/bin/curl 'http://209.222.18.222:2000/?client_id=080db0a6e936918d405683447a78bf426273e9a1ea2ecce744722ac3241d4232'
- 28: json=
- 29: '[' '' == '' ']'
- 30: json='Port forwarding is already activated on this connection, has expired, or you are not connected to a PIA region that supports port forwarding'
- 33: /bin/echo server returned message: Port forwarding is already activated on this connection, has expired, or you are not connected to a PIA region that supports port forwarding
- 336: echo Port forwarding is already activated on this connection, has expired, or you are not connected to a PIA region that supports port forwarding
- 336: /usr/bin/awk 'BEGIN{r=1;FS="[{}":]+"} /port/{r=0; print $3} END{exit r}'
- 36: PORT=
- 37: /bin/echo if successful port is:
- 41: /opt/bin/transmission-remote 192.168.1.251 --auth me:pass -p ''
- 42: /bin/echo your transmission details: 192.168.1.251 me pass
- 16: client_id_file=/etc/openvpn/pia_client_id
- 17: '[' '!' -f /etc/openvpn/pia_client_id ']'
- 227: /bin/cat /etc/openvpn/pia_client_id
- 27: client_id=080db0a6e936918d405683447a78bf426273e9a1ea2ecce744722ac3241d4232
- 228: /opt/bin/curl 'http://209.222.18.222:2000/?client_id=080db0a6e936918d405683447a78bf426273e9a1ea2ecce744722ac3241d4232'
- 28: json='{"port":44257}'
- 29: '[' '{"port":44257}' == '' ']'
- 33: /bin/echo server returned message: '{"port":44257}'
- 336: echo '{"port":44257}'
- 336: /usr/bin/awk 'BEGIN{r=1;FS="[{}":]+"} /port/{r=0; print $3} END{exit r}'
- 36: PORT=44257
- 37: /bin/echo if successful port is:44257
Add Comment
Please, Sign In to add comment