Page 1 of 1

CLI Options to control viscosity?

Posted: Sun Jul 24, 2011 4:27 am
by LitlJay
My VPN provider has a great service with lots of servers, but provides terrible proprietary software. Fortunately, they will provide certificates for customers savvy enough to use their own OVPN client, and I like the looks of viscosity because of the easy management of multiple connections and connect/disconnect scripts, etc...

I do have a few questions that I need answered before I decide if I'm willing to shell out $9 before the end of 30 days:
  • Is there a way to auto-reconnect if a connection drops?
  • If a server is down, can I have it failover to another connection?
  • Can the above and/or other advanced functions be initiated from the command line, via a batch script for example?
The client looks great, so I hope I can get this stuff resolved!

TIA,

J

Re: CLI Options to control viscosity?

Posted: Tue Jul 26, 2011 9:47 am
by Eric
Hi LitlJay,

I'll answer your questions as best I can.
LitlJay wrote:
  • Is there a way to auto-reconnect if a connection drops?
Yes - In the case the server drops, openvpn will attempt to reconnect automatically. In the case that the server is no longer reachable at all, Viscosity will detect this and ask you if you would like to automatically reconnect when the server is reachable again.
LitlJay wrote:
  • If a server is down, can I have it failover to another connection?
If your certificates are the same for each server, you can enter multiple servers in the "remote address" field of your connection separated by a semi-colon ';'. OpenVPN will then try these in order until it can reach one. If one happens to drop out, the next one will be tried.
LitlJay wrote:
  • Can the above and/or other advanced functions be initiated from the command line, via a batch script for example?
This is a planned feature for a not too distant release. You will be able to do things like connect a connection and disconnect a connection (e.g. "Viscosity.exe --connect My Connection). What other functions did you envisage being able to do from command line?

Cheers,

Eric

Re: CLI Options to control viscosity?

Posted: Wed Feb 29, 2012 5:32 am
by omascia
Hello,

I'm pinging this topic. I too need to control tunnel connections from some system batches (.CMD for instance) or from some in-house programming (build automates needing to open tunnels on-demand to proceed with some uploads and the like).

Something very simple would be enough. A command-line command to open a tunnel (if found closed) or silently report success if found already opened. And one to close a tunnel, again silently reporting success if found already closed. I don't mind missing options for username / passwords and so to have to use only self-contained tunnel configurations (with credentials previously saved).

I have not checked in detail, but am I right thinking it is already possible on Mac through AppleScript?

Maybe I could have a look at controlling openvpn.exe instances directly?

Regards,
--
Olivier

Re: CLI Options to control viscosity?

Posted: Wed Feb 29, 2012 8:55 pm
by Eric
Hi Olivier,

We have just added this functionality to the latest beta. It's not documented yet, but the commands are quite simple:

Viscosity.exe connect "Connection Name"
Viscosity.exe disconnect "Connection Name"

The first will connect a connection, the second will disconnect. If Viscosity is not already running, it will start and then connect the connection specified. The latest beta is available here - http://www.thesparklabs.com/forum/viewt ... ?f=7&t=482

Regards,

Eric

Re: CLI Options to control viscosity?

Posted: Wed Feb 29, 2012 10:00 pm
by omascia
Great, I will move up to the beta version.
Thanks!

Re: CLI Options to control viscosity?

Posted: Wed Feb 29, 2012 10:08 pm
by omascia
Woops, installing the beta immediately tells me the evaluation period (started only 3 or 4 days ago) has ended. :?
Well I guess I'll have to decide quicker on purchase (today). But fair enough, I think I have built enough confidence in the product in those last 3 days anyway. ;)

Re: CLI Options to control viscosity?

Posted: Wed Feb 29, 2012 10:14 pm
by Eric
Hi Olivier,

It should have gone from where the last version left off. We will definitely investigate that.

Cheers,

Eric