A Mac LaunchAgent to automatically reconnect Cisco Secure Client whenever it disconnects and won't automatically reconnect itself (typically after a long sleep). In particular, this:
- Open System Preferences and go to "Privacy & Security" and then "Accessibility".
- Click the "+" button in the bottom left, navigate to
/usr/bin/
, and addosascript
; making sure that it's slider is enabled (see screenshot below). - Checkout this repo somewhere that you want to keep it.
- Run
install.sh
.
Basically, this is an Applescript that checks every 10 seconds if the Cisco Secure Client is connected, and if not, click the "Connect" button - all via the UI because the Cisco Secure Client is not scriptable. Note that because we're checking every 10 seconds, you cannot realistically stay disconnected from the VPN while this is running unless you actually quit Cisco Secure Client.
osascript
is the shell to run Applescripts (see here
for more details), hence why it needs to be allowed in the System Preferences.
If it doesn't seem to be working, try checking the logs at
~/Library/Logs/cisco-reconnect/stderr.log
and ~/Library/Logs/cisco-reconnect/stdout.log
for
any details.
- Run
uninstall.sh
. - (Optional) Remove
osascript
from the "Accessibility" System Preferences.