Automatically launch VPNs when different addons are opened

  Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Alth79 Offline
Junior Member
Posts: 38
Joined: Mar 2015
Reputation: 0
Post: #16
Sounds promising!

I have three batch files at the moment - UK, US and Australian. For example - If the UK batch file is ran it closes any VPN connections that are active and then attempts to connect the UK VPN. I also have a disconnect batch file to simply close any VPN connections.
find quote
marv_el Offline
Senior Member
Posts: 219
Joined: Aug 2009
Reputation: 8
Location: Vienna, Austria
Post: #17
ok, so does it need to disconnect the vpn connection when you leave a certain addon?
the service addon as it is connects when entering a specific addon and disconnects when leaving the addon. is this necessary?
need to know whether i need an additional setting for a "disconnect batch file".
find quote
Alth79 Offline
Junior Member
Posts: 38
Joined: Mar 2015
Reputation: 0
Post: #18
No need for the addon to disconnect with how my batch files are set up - when my batch file is ran it closes any VPN connections that are active before another vpn is connected. Is this how your addon works? If your addon closes a vpn connection when exiting an addon that is also good for me - I can create new batch files to fit with how your addon works. I am happy to make my set up fit however your addon requires.

Cheers again!
find quote
Alth79 Offline
Junior Member
Posts: 38
Joined: Mar 2015
Reputation: 0
Post: #19
Hi marv_el, are there any changes that I could make to the addon to make it work with advanced launcher rather than the openvpn addon? I have created new batch files so have vpn batch files that would fit with how your addon currently works.

Thanks for your time
find quote
marv_el Offline
Senior Member
Posts: 219
Joined: Aug 2009
Reputation: 8
Location: Vienna, Austria
Post: #20
just came home from work. i will make the changes a lil bit later. cu
find quote
invisable Offline
Senior Member
Posts: 176
Joined: Dec 2013
Reputation: 2
Post: #21
marv_el many thanks for sharing your work, I'm hoping to have a play with it later if you don't mind me asking did you write this for Kodi or Xbmc ?
find quote
marv_el Offline
Senior Member
Posts: 219
Joined: Aug 2009
Reputation: 8
Location: Vienna, Austria
Post: #22
invisable: should work for both versions.

alth79: here is my first attempt to use batch files:
https://www.dropbox.com/s/1xpyd1yqjl09k1...e.zip?dl=0

go to settings and select the batch file u need under the addon name. the batch file must disconnect the current connection before establishing another vpn connection. no need to use a separate batch file to disconnect!
btw. this version doesn't require the advanced launcher!

please try and tell me if it works.
(This post was last modified: 2015-03-26 22:15 by marv_el.)
find quote
Alth79 Offline
Junior Member
Posts: 38
Joined: Mar 2015
Reputation: 0
Post: #23
Brilliant, thanks for sharing. I will give it a try and let you know how it goes. Do I need to locate the batch files in any particular place? Do I use the batch file name or VPN name in the addon? Sorry if these are daft questions!

Cheers
find quote
marv_el Offline
Senior Member
Posts: 219
Joined: Aug 2009
Reputation: 8
Location: Vienna, Austria
Post: #24
yes, you have to select the batch files in the settings from the service addon. enter the name of the addon and select the batch file, which should be executed.
in case you see a pop up window i can try to suppress it by using another command. i am not familiar with this so i have to try out.

but tell me first if it works.
find quote
invisable Offline
Senior Member
Posts: 176
Joined: Dec 2013
Reputation: 2
Post: #25
@marv_el I've tried your add-on and it works great. Had a minor problem setting it up but it was down to my own error. Since reading your instructions again I removed the captial letter from my vpn file
Ie. Changed "Germany" to "germany" and it works fine.

Thanks for sharing, I have a feeling this could become quite popular.
Many thanks!!

Have you thought about uploading your addon to github ?
(This post was last modified: 2015-03-27 20:25 by invisable.)
find quote
marv_el Offline
Senior Member
Posts: 219
Joined: Aug 2009
Reputation: 8
Location: Vienna, Austria
Post: #26
true, it uses lower case names. fits my needs, but i easily can change it back. didn't think about that, since it wasn't meant to be released. but thanks for the hint.
i am thinking about your idea to upload it on github.

glad to hear that it works for you!
find quote
invisable Offline
Senior Member
Posts: 176
Joined: Dec 2013
Reputation: 2
Post: #27
(2015-03-27 20:52)marv_el Wrote:  true, it uses lower case names. fits my needs, but i easily can change it back. didn't think about that, since it wasn't meant to be released. but thanks for the hint.
i am thinking about your idea to upload it on github.

glad to hear that it works for you!
No worries, I'm thankful your kind enough to share. The reason I asked about the question about github is a while ago I wrote a brief guide (on a Kodi addon site) on how to set up Brian's openvpn addon on the raspberry pi.
To my surprise "as I've got quite bad dyslexia", Brian saw this and was using it to redirect people that were having trouble setting it up on his website. Anyway he's now posted the guide on his site, but in the guide I wrote, I could compliment your addon if you like. I've got a feeling your addon could become quite popular.
I understand if you don't want to though, as I said earlier, I'm grateful that your kind enough to share with us on here.
(This post was last modified: 2015-03-28 09:23 by invisable.)
find quote
Alth79 Offline
Junior Member
Posts: 38
Joined: Mar 2015
Reputation: 0
Post: #28
marv_el what can I say - your addon is absolutely fantastic! Works a treat! Thank you very much for sharing! Gives my htpc a true feeling of being a corporate/professional/paid for/true cable cutting build as I can now nip in and out of any addon from any country without the need to manually toggle a vpn connection - exactly what I was hoping for when I opened this thread! Needless to say the WAF has also gone through the roof!!

Like invisable has said, this really could become a very popular addon, as long as people know how to create the batch files. If you were to release this - the version that you mentioned in an earlier post that also disconnects the vpn when exiting the addon would also be helpful.

Thanks again!!
find quote
marv_el Offline
Senior Member
Posts: 219
Joined: Aug 2009
Reputation: 8
Location: Vienna, Austria
Post: #29
thanks for the positive feedback. your input is very helpful.
when i find the time i will improve the addon as suggested and upload it on github.
find quote
Alth79 Offline
Junior Member
Posts: 38
Joined: Mar 2015
Reputation: 0
Post: #30
Hi marv_el, still loving your addon! Was wondering if the kodi library could be linked to a vpn like the other addons are? In my library I have a mixture of local movies and TV shows and also streams from addons which when played are opened from the addon. If I could link my library to a USA vpn that would be ideal.

No worries if not, just putting ideas out there.

Cheers
find quote