File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ function _lazy_connect_init() {
13
13
14
14
function _lazy_connect_vpn_refresh() {
15
15
echo " refreshing vpn..."
16
- vpnNames=$( osascript << EOF
16
+ cp $config_dir /vpns ${TMPDIR} lc_vpns
17
+ osascript << EOF |
17
18
tell application "System Events"
18
19
tell process "SystemUIServer"
19
20
set vpnMenu to (menu bar item 1 of menu bar 1 where description is "VPN")
@@ -33,12 +34,9 @@ function _lazy_connect_vpn_refresh() {
33
34
end tell
34
35
end tell
35
36
EOF
36
- )
37
- cp $config_dir /vpns ${TMPDIR} lc_vpns
38
- updated_vpns=$( echo $vpnNames | tr , " \n" | xargs -I{} echo {})
39
- echo $updated_vpns > $config_dir /vpns
40
- echo " Updated VPN List:"
41
- diff $config_dir /vpns ${TMPDIR} lc_vpns
37
+ tr ' ,' ' \n' | sed ' s/^[[:space:]]//g' > $config_dir /vpns
38
+ echo " Updated VPN List:"
39
+ diff $config_dir /vpns ${TMPDIR} lc_vpns
42
40
}
43
41
44
42
function _lazy_connect_usage() {
You can’t perform that action at this time.
0 commit comments