Page 1 of 1

Sripting-Support (Call shell script after connect)

Posted: Tue Sep 15, 2009 9:34 am
by andreaspiening
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

Re: Sripting-Support (Call shell script after connect)

Posted: Wed Sep 16, 2009 2:22 am
by James
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