Skip to content

Commit

Permalink
Cleaner connection attempt with viscosity
Browse files Browse the repository at this point in the history
  • Loading branch information
Euan Reid committed Nov 27, 2016
1 parent 81844e3 commit f7b8954
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ec2gaming.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
INSTANCE_TYPE="g2.2xlarge"
SPOT_PRICE_BUFFER="0.10"
VPN_CLIENT="tunnelblick"
VPN_CLIENT="viscosity"
11 changes: 7 additions & 4 deletions scripts/ec2gaming-vpnup.viscosity.scpt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
tell application "Viscosity"
connect (connections where name is "ec2gaming")
set currentState to state of connections where name is "ec2gaming"
repeat until currentState = "Connected"
delay 1
set currentState to "Unknown"
repeat until (currentState = "Connected")
if currentState = "Disconnected" then
connect (connections where name is "ec2gaming")
end if
set currentState to state of connections where name is "ec2gaming"
set currentState to currentState as string
delay 1
end repeat
end tell

0 comments on commit f7b8954

Please sign in to comment.