-
Notifications
You must be signed in to change notification settings - Fork 13
/
05_vpn
36 lines (33 loc) · 1.02 KB
/
05_vpn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Some simple functions to control Viscosity
if [[ -x '/Applications/Viscosity.app' || -x "$HOME/Applications/Viscosity.app" ]]; then
function vpnc {
CONN=$1
if [[ -z $CONN ]]; then
print 'Missing profile argument'
print "Usage: $0 <profile>"
return 1;
fi
osascript -e 'on run argv
tell Application "Viscosity" to activate
tell Application "Viscosity" to connect item 1 of argv
end run' $CONN
}
function vpnca {
osascript -e 'tell application "Viscosity" to activate
tell Application "Viscosity" to connectall'
}
function vpnd {
CONN=$1
if [[ -z $CONN ]]; then
print 'Missing profile argument'
print "Usage: $0 <profile>"
return 1;
fi
osascript -e 'on run argv
tell Application "Viscosity" to disconnect item 1 of argv
end run' $CONN
}
function vpnda {
osascript -e 'tell Application "Viscosity" to disconnectall'
}
fi