Talking to Tunnelblick

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
peter.s
Posts: 99
Joined: Thu Jul 10, 2008 11:47 am

Talking to Tunnelblick

Post by peter.s » Mon Mar 31, 2014 10:30 am

I hope I've posted this in the right section :-) I'm trying to talk to another program, but I'm not having much luck.

For those who don't know it - Tunnelblick is an open source interface for OpenVPN ( https://code.google.com/p/tunnelblick/ ). Rather than having my program deal with VPN configurations, I want to tell Tunnelblick to connect to a specific server or country with its existing configurations.

I've written a script that will open and quit the program easily enough, but when it's open I can't get it to make a connection.

Does anyone have any ideas?

peter.s
Posts: 99
Joined: Thu Jul 10, 2008 11:47 am

Re: Talking to Tunnelblick

Post by peter.s » Mon Mar 31, 2014 11:29 am

I've just discovered that I can get Tunnelblick to generate a .plist file - to tell it to open and connect on computer start-up.

Is there some way I can utelise a .plist file? Perhaps stash it somewhere and direct Tunnelblick to it?

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Talking to Tunnelblick

Post by mwieder » Mon Mar 31, 2014 7:16 pm

There's a commandline interface to Tunnelblick called openvpnstart buried inside the app hierarchy in /Applications/Tunnelblick.app/Contents/Resources. If you launch it with no arguments it will fill several screens with info. Untested here because I only have need of a single vpn server connection, but you should be able to point it to a config file to connect to a different server. I'm not sure whether a plist file will do the trick, the help info mentions .conf, .opn, or .tblk files.

BTW, my default plist file for Tunnelblick is in ~/Library/Preferences/net.tunnelblick.tunnelblick.plist.

peter.s
Posts: 99
Joined: Thu Jul 10, 2008 11:47 am

Re: Talking to Tunnelblick

Post by peter.s » Tue Apr 01, 2014 2:14 pm

Thanks mwieder for your response.

I've had a look at that file and can't figure out what I can do with the openvpnstart command. I am a novice with code (but trying hard). I've tried a few things unsuccessfully, so I suspect I will need to include some AppleScript into my stack?

Tunnelblick does keep its main plist in User/Library/Preferences. If in Tunnelblick I select a VPN profile to connect when Tunnelblick starts, that command is included in that plist. The plist is updated if I select a different profile.

But, if I select a VPN profile to connect on computer start, Tunnelblick puts a new plist in Library/LaunchDaemons.

My thinking is that I could generate a plist for each profile to connect on open, and hijack them from their folders - put them where I want and direct my app to them? But how does one utilise a plist - is it some kind of Apple Event?

Or is it better to somehow use the openvpnstart command?

Scratching my head here… :-)

Post Reply