Skip to content
Feature Request : scripting before connection
Suggestions/comments/criticisms are welcome here
Hello,
First of all, thank you for your nice software! It's working great
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
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
First of all, thank you for your nice software! It's working great
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
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
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
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
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
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
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
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
4 posts
Page 1 of 1