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:
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:
- Download hma-udp-grabber.sh script and save it in some folder. In our example, we have saved it in ~/Desktop
- Download and save hma-scheduled-runner.sh It is just a working example which will help you build your own custom script.
- Run the Terminal, type cd ~/Desktop/ and press enter.
- Make it executable: sudo chmod +x hma-udp-grabber.sh
- Run it: sudo sh hma-udp-grabber.sh (don't run it via ./hma-udp-grabber.sh - that would not work!)
- Click Yes and provide your HMA! Credentials when prompted.
- Congratulations! Correct .ovpn files are set in place.
- In order to test it, run sudo chmod +x hma-scheduled-runner.sh then sudo sh hma-scheduled-runner.sh
- 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/
- 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.