SparkLabs Forum.

Community Help.


Disconnect on screen lock, and reconnect on unlock?

Is there a way to disconnect VPN connections when the screen is locked, and reconnect when it is unlocked again?

I realize that is the opposite of what many people want (stay connected while locking the screen), but I have a VPN server that allows only a single connection (per user), so when I forget to disconnect on my work machine, I cannot connect to the server from my laptop or my home machine.

I know I can use Screen Sharing to do a remote login to the work machine to disconnect the VPN, but I would prefer if this was all automatic (the machine is always locked when I leave, and auto-locks after a time anyways).
Hi jandubois,

I'm afraid Viscosity doesn't have any options for screen locked/unlocked events, however the "Disconnect connections after x minutes of inactivity" option under Preferences->Advanced would probably do the trick for disconnecting. You can set the time to match the time you have for your screen to lock or turn off when idle.

Otherwise, you should be able to find a third-party tool (e.g. ControlPlane) that allows you to invoke AppleScripts on certain actions (like the screen locking or unlocking) and then use Viscosity's scripting support to connect/disconnect your VPN connection:
https://www.sparklabs.com/support/kb/ar ... cript-mac/

Cheers,
James
2 posts Page 1 of 1

Copyright © 2016 SparkLabs Pty Ltd. All Rights Reserved. Privacy Policy