HideMyAss VPN

Showing posts with label Scheduled IP change for Linux. Show all posts
Showing posts with label Scheduled IP change for Linux. Show all posts

Tuesday, April 30, 2013

Scheduled IP change for Linux

Would it be possible to start and stop HMA! Pro VPN programmatically via the cronjob or a command line script?

Yes, but that is not possible in the default configuration. It requires a bit more work.
The method described here works on all distributions, and on command-line as well as via GUIs.
Requirement is the openvpn package. Step-by-step guide follows:

  1. Download hma-udp-grabber.sh script and save it in some folder. In our example, we have saved it in ~/Desktop
  2. Download and save hma-scheduled-runner.sh It is just a working example which will help you build your own custom script.
  3. Run the Terminal, type cd ~/Desktop/ and press enter.
  4. Make it executable: sudo chmod +x hma-udp-grabber.sh
  5. Run it: sudo sh hma-udp-grabber.sh (don't run it via ./hma-udp-grabber.sh - that would not work!)

 


  1. Click Yes and provide your HMA! Credentials when prompted.

 



  1. Congratulations! Correct .ovpn files are set in place.
  2. In order to test it, run sudo chmod +x hma-scheduled-runner.sh then sudo sh hma-scheduled-runner.sh

 


  1. IP address will start cycling randomly. You may press CTRL + C to stop the loop.
    To check the assigned IP address, you may use our HMA! IP Checker browser extension
    http://hidemyass.com/software/ip-checker-browser-extension/

 


  1. Combine the method described above with a clever use of the export display command (export DISPLAY=:0) and some other scripting and this could easily be converted to a cron job.