Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (33 sloc) 1.02 KB
# 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