Advertisement
Spacetech

Untitled

Dec 8th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #!/bin/sh
  2. PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
  3.  
  4. USER="a"
  5. PASSWORD="a"
  6.  
  7. echo 'Loading port forward assignment information..'
  8.  
  9. local_ip=`ifconfig tun0 | grep "inet " |cut -d\ -f2 | tee /tmp/vpn_ip`
  10. client_id=`head -n 100 /dev/urandom | md5 -r | tr -d " -"`
  11.  
  12. echo $USER
  13. echo $PASSWORD
  14. echo $local_ip
  15. echo $client_id
  16.  
  17. curl_args="-k -d user=$USER&pass=$PASSWORD&client_id=$client_id&local_ip=$local_ip"
  18. curl_url="https://www.privateinternetaccess.com/vpninfo/port_forward_assignment"
  19.  
  20. echo $curl_args
  21.  
  22. json="$(curl $curl_args $curl_url)"
  23.  
  24. echo $json
  25.  
  26. PORTNUM=`echo $json | grep -oE "[0-9]+"`
  27.  
  28. echo $PORTNUM
  29.  
  30. tr="$(transmission-remote -p $PORTNUM)"
  31.  
  32. echo $tr
  33.  
  34. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement