Sripting-Support (Call shell script after connect)

Suggestions/comments/criticisms are welcome here

andreaspiening

Posts: 1
Joined: Tue Sep 15, 2009 9:20 am

Post by andreaspiening » Tue Sep 15, 2009 9:34 am
Hi,

I wonder if there would be (or allready is) simple scripting-support in Viscosity. What I mean is the ability to call a shell-script (e.g. bash or wharever) automatically after a sucessfull connect. The script to call must be selectable on a per connection base, so it can be used to mount remote volumes, do dns-magic or whatever is needed to make use of opportunities that comes in with the newly connected network. A script which is called directly before the connection is closed is usefull, too. For example to unmount network shares. The windows-gui "OpenVPN GUI" solves this by placing an optional batch-file with the name "<network>_up.bat" respectively "<network>_down.bat" which is then called when a connection change is triggered.

I've allready asked this question to the support (via contact form) but unfortunately without a response.

Thank you in advance,

Andreas Piening

James

User avatar
Posts: 1857
Joined: Thu Sep 04, 2008 9:27 pm

Post by James » Wed Sep 16, 2009 2:22 am
Hi Andreas,

Viscosity doesn't provide a GUI for specifying scripts to run on connect (up scripts) or scripts to run on disconnect (down scripts), however these can be specified using OpenVPN commands like so:

1. Edit your connection in Viscosity
2. Under the General tab un-tick the "Enable DNS Support" checkbox to turn off Viscosity's own up/down DNS support scripts
3. Click on the Advanced tab
4. Enter on a new line "up /path/to/your/up/script.sh" (without the quotes)
5. Do the same for your down script "up /path/to/your/down/script.sh" (without the quotes)
6. Click Save

You can see the OpenVPN documentation for more information about up/down scripts.
I've allready asked this question to the support (via contact form) but unfortunately without a response.
I'm afraid there has been a huge influx of support requests since the early release of Snow Leopard, and so requests deemed to be high priority must be answered first. Apologies for the delay.

Cheers,
James
James Bekkema
Viscosity Developer

Web: http://www.sparklabs.com
Support: http://www.sparklabs.com/support
Twitter: http://twitter.com/sparklabs
2 posts Page 1 of 1