Viscosity. OpenVPN client. For Mac.  
 
 

Feature Request : scripting before connection

Suggestions/comments/criticisms are welcome here

Feature Request : scripting before connection

Postby blop » Wed Aug 04, 2010 8:48 pm

Hello,

First of all, thank you for your nice software! It's working great :mrgreen:

I saw you recently added the possibility to execute an applescript after the connection/disconnection.

I'd like to know if you could also add an option to execute a script BEFORE the connection to the vpn server is started.
I need to execute a script, and be sure it's completed, before the connection to the server can be made (so it must wait for the script, maybe check the result code also).

That shouldn't be too much work :oops:

Maybe you should have :
before connection script
after connection script -> that one already exists
before disconnection script
after disconnection script -> that one already exists

So that all possible cases are covered ;)

Thank you already !

Olivier
blop
 
Posts: 1
Joined: Wed Aug 04, 2010 6:53 pm

Re: Feature Request : scripting before connection

Postby James » Thu Aug 12, 2010 12:39 pm

Hi Olivier,

Thanks for the feedback. We are definitely looking at adding the ability to run actions on more events, so it's something you should see if a future version.

In the meantime a workaround could be to write an AppleScript script that first runs your own code, and then tells Viscosity to connect your VPN connection.

Cheers,
James
User avatar
James
 
Posts: 947
Joined: Thu Sep 04, 2008 10:27 pm

Re: Feature Request : scripting before connection

Postby hyper » Mon Feb 14, 2011 11:50 pm

Hi James,

Any update on this? Do you have a target release date in mind?
hyper
 
Posts: 3
Joined: Mon Feb 14, 2011 11:49 pm

Re: Feature Request : scripting before connection

Postby James » Tue Feb 22, 2011 3:55 am

Hi hyper,

Support has been added to the latest beta, however there is no GUI for it at this stage. The latest beta version can be downloaded here. If you're happy to edit the config file directly it's quite easy to add a "Before Connect" script:

1. Find the config file Viscosity has generated for your connection. This can be found at:
Your Home Folder/Library/Application Support/Viscosity/OpenVPN/#/config.conf

2. Open the config file in a text editor (such as TextEdit) and add the following line (replacing the path to your script):
#viscosity preconnectscript /path/to/script.scpt

3. Save the changes and restart Viscosity.

Viscosity also now support global Connected/Disconnect scripts. Again, there is no GUI for this yet however you can set global Connected/Disconnected scripts from the Terminal (you'll have to restart Viscosity afterwards), for example:

defaults write com.viscosityvpn.Viscosity globalConnectedScript "/path/TestConnect.scpt"
defaults write com.viscosityvpn.Viscosity globalDisconnectedScript "/path/TestDisconnect.scpt"

If you run into any problems with the latest beta version please let us know!

Cheers,
James
User avatar
James
 
Posts: 947
Joined: Thu Sep 04, 2008 10:27 pm


Return to Viscosity Feedback

Who is online

Users browsing this forum: No registered users and 0 guests



cron
 
 
 
 
Navigate

Home
Applications
Blog
About
Support
  Support

Support Home
Documentation
Knowledge Base
Forum
  Community

Blog
Forum
Twitter
Viscosity
Viscosity Server


 
 
SparkLabs Copyright © SparkLabs. All Rights Reserved.