Thoughts on a panel applet that does the PIA homepage check to monitor "protected" or not?
Hi all,
One of the things I find I am in a habit of doing is hitting the pia home page to "get the green" so to speak.
I use a number of different linux distros and generally don't bother with the thick-client and do the setup in openVPN.
I got to thinking that a bash script, python or javascript applet could monitor the header on the pia homepage and by a simple curl or wget and grep determine if the http request returns "You are protected by PIA"...
I did a bash script that uses wget to pull the page then pipes cat index.html to grep with an if statement that checks for the relevant text - but I don't really know how to code properly and wondered if anyone had tackled something like this for general openvpn tunnel heart-beat type monitoring.
I thought a cinnamon panel applet (javascript) that had a simple green or red light and could be clicked to force the check and maybe a popup notification if the state changed between regular automated checks (say every 5 min) could be very useful?
Don't really know where to start beyond what I've tried so I thought I'd throw the idea out and see if anyone else is interested or relates to the usecase...
Writing applets seems relatively easy once you get started...
ie: http://developer.linuxmint.com/reference/git/cinnamon-tutorials/write-applet.html
Best,
Will;
One of the things I find I am in a habit of doing is hitting the pia home page to "get the green" so to speak.
I use a number of different linux distros and generally don't bother with the thick-client and do the setup in openVPN.
I got to thinking that a bash script, python or javascript applet could monitor the header on the pia homepage and by a simple curl or wget and grep determine if the http request returns "You are protected by PIA"...
I did a bash script that uses wget to pull the page then pipes cat index.html to grep with an if statement that checks for the relevant text - but I don't really know how to code properly and wondered if anyone had tackled something like this for general openvpn tunnel heart-beat type monitoring.
I thought a cinnamon panel applet (javascript) that had a simple green or red light and could be clicked to force the check and maybe a popup notification if the state changed between regular automated checks (say every 5 min) could be very useful?
Don't really know where to start beyond what I've tried so I thought I'd throw the idea out and see if anyone else is interested or relates to the usecase...
Writing applets seems relatively easy once you get started...
ie: http://developer.linuxmint.com/reference/git/cinnamon-tutorials/write-applet.html
Best,
Will;
Comments
and write your first version with bash (and awk and/or sed and/or grep and/or ...)
so switching the vpn off and back on yielded the hoped for results.
here is the script
Now I need to work out how to write an applet that calls this and does it with the cinnamon dock
Update:-
crude attempt to frame up something that will start the applet ball rolling - doesn't work. Some problem converting the .sh to utf8.
this.set_applet_tooltip(_("Click here to check PIA"));Util.spawn("/home/will/Code/first_scrape.sh");now, there's all sorts of good information on that whats-my-ip page. get more of it with a command line option? always good to self-document with the output from the --help option. try next to not use temp files.