Page 1 of 1

Can Viscosity config options be set in preconnect scripts?

Posted: Tue May 19, 2020 1:59 am
by engineerbert
I'm trying to set some Viscosity config options using a preconnect script (specifically I'm trying to set some routes so that only certain traffic goes through the VPN). I've got an Applescript calling a shell script to do so, but I'm not sure how to actually set a route. Is this possible and if so how? Thanks!

Re: Can Viscosity config options be set in preconnect scripts?

Posted: Tue May 19, 2020 3:52 pm
by James
Hi engineerbert,

I'm afraid it is not possible to set or change configuration options from a Before Connect script.

It is possible to set routes from a script, however please keep in mind adding or removing routes requires administration rights. You'd need to run the route commands in your script, or the entire script itself, as an administrator.

Running a shell script as an administrator is discussed here:
https://www.sparklabs.com/support/kb/ar ... ell-script

However unless these routes change significantly each time you connect, you may be able to set them in your connection itself:
https://www.sparklabs.com/support/kb/ar ... lications/

Cheers,
James