Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
- USER="a"
- PASSWORD="a"
- echo 'Loading port forward assignment information..'
- local_ip=`ifconfig tun0 | grep "inet " |cut -d\ -f2 | tee /tmp/vpn_ip`
- client_id=`head -n 100 /dev/urandom | md5 -r | tr -d " -"`
- echo $USER
- echo $PASSWORD
- echo $local_ip
- echo $client_id
- curl_args="-k -d user=$USER&pass=$PASSWORD&client_id=$client_id&local_ip=$local_ip"
- curl_url="https://www.privateinternetaccess.com/vpninfo/port_forward_assignment"
- echo $curl_args
- json="$(curl $curl_args $curl_url)"
- echo $json
- PORTNUM=`echo $json | grep -oE "[0-9]+"`
- echo $PORTNUM
- tr="$(transmission-remote -p $PORTNUM)"
- echo $tr
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement