thecasualcoder / lazy-connect

Shell function to fuzzy search an IPSec VPN by name and connect to it automatically.
56 stars 17 forks source link

Sometimes script throws error on lazyconnect #20

Closed thamaraiselvam closed 5 years ago

thamaraiselvam commented 5 years ago

the following error is been thrown

600:666: execution error: System Events got an error: Can’t get button "Authentication Settings…" of group 1 of window 1 of process "System Preferences". (-1728)

May be should add a delay?

thamaraiselvam commented 5 years ago

It occurs when trying to connect VPN is already connected because

osx_vpn_name="${vpn_name/Connect /}, Not Connected"

gets only Not Connected VPNs

thamaraiselvam commented 5 years ago

So let's suppress error by checking Authentication Settings exist? or remove Not Connected from osx_vpn_name="${vpn_name/Connect /}, Not Connected"?

thamaraiselvam commented 5 years ago

Sometimes it happens for not connected VPNs as well.

jpninanjohn commented 5 years ago

Closing as its a duplicate