Can Viscosity config options be set in preconnect scripts?

Got a problem with Viscosity or need help? Ask here!


Posts: 1
Joined: Tue May 19, 2020 1:55 am

Post by engineerbert » Tue May 19, 2020 1:59 am
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!


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

Post by James » Tue May 19, 2020 3:52 pm
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: ... ell-script

However unless these routes change significantly each time you connect, you may be able to set them in your connection itself: ... lications/

James Bekkema
Viscosity Developer

2 posts Page 1 of 1