Difference between revisions of "VPN AppleScript Auto Reconnect"

From BTGuard Wiki
Jump to: navigation, search
 
(23 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
  <div class="right">
 
  <div class="right">
 
   <p>
 
   <p>
== VPN Script for Mac ==
+
== How To use the Auto Reconnect VPN Script for Mac ==
 
<br/>
 
<br/>
 
This script will monitor the status of your VPN connection and will automatically try to reconnect you to the VPN if you're disconnected.<br/>
 
This script will monitor the status of your VPN connection and will automatically try to reconnect you to the VPN if you're disconnected.<br/>
 
<br/>
 
<br/>
This will also allow you to select a program (utorrent in this case) that will automatically be shutdown when disconnected and reopened when reconnected.<br/>
+
This will also allow you to select a program (uTorrent in this example) that will automatically be shutdown when disconnected and reopened after the VPN reconnected.<br/>
 
<br/>
 
<br/>
 
   </p>
 
   </p>
Line 26: Line 26:
 
  <div class="right">
 
  <div class="right">
 
   <p>
 
   <p>
 
+
There are some limitations to this script. Once it's started, you '''CANNOT''' disconnect from the VPN or close your torrent program as the script will automatically reconnect to the VPN and launch the program. The only way to stop the script is by restarting the computer.
 +
<br/><br/><br/>
 +
1. First, you'll need to open the '''AppleScript Editor''' and go to '''Preferences'''.
 
<br/>
 
<br/>
 
   </p>
 
   </p>
Line 41: Line 43:
 
  <div class="right">
 
  <div class="right">
 
   <p>
 
   <p>
 
 
<br/>
 
<br/>
  </p>
+
2. Make sure '''Show Script menu in menu bar''' is checked. <br/>
</div>
+
</div>
+
 
+
 
+
<div class="wrapper">
+
<div class="wrapleft">  
+
  <div class="left">
+
<span class="plainlinks">[https://wiki.btguard.com/images/VPNscript_4.png https://wiki.btguard.com/images/VPNscript_4.png]</span>
+
  </div>
+
</div>   
+
<div class="right">
+
  <p>
+
 
+
 
<br/>
 
<br/>
 +
'''THE FOLLOWING SCRIPTS WILL ONLY WORK IF YOU FOLLOWED [[PPTP_Mac_OS_X|THESE INSTRUCTIONS]] TO THE LETTER FOR THE [[PPTP_Mac_OS_X|PPTP METHOD]] AND YOUR VPN CONNECTION IS PROPERLY NAMED: BTGuard VPN'''<br/>
 +
<br/>
 +
3. To make things easier, we have created some pre-configured scripts for some torrent clients.
 +
Please download the appropriate script depending on the torrent client you use:<br/>
 +
*[https://wiki.btguard.com/uploads/VPNscript_uTorrent.zip uTorrent]
 +
*[https://wiki.btguard.com/uploads/VPNscript_Vuze.zip Vuze]
 +
*[https://wiki.btguard.com/uploads/VPNscript_qBittorrent.zip qBittorrent]
 +
*[https://wiki.btguard.com/uploads/VPNscript_Deluge.zip Deluge]
 +
*[https://wiki.btguard.com/uploads/VPNscript_Transmission.zip Transmission]
 +
''If the program you use is not listed above, please scroll down to the '''[[#How To Edit the scripts|How To Edit the scripts]]''' section.'' <br/>
 
   </p>
 
   </p>
 
  </div>
 
  </div>
 
</div>
 
</div>
  
 
<div class="wrapper">
 
<div class="wrapleft">  
 
  <div class="left">
 
<span class="plainlinks">[https://wiki.btguard.com/images/VPNscript_5.png https://wiki.btguard.com/images/VPNscript_5.png]</span>
 
  </div>
 
</div>   
 
<div class="right">
 
  <p>
 
 
<br/>
 
  </p>
 
</div>
 
</div>
 
  
  
Line 86: Line 70:
 
  <div class="right">
 
  <div class="right">
 
   <p>
 
   <p>
 
+
4. Click on the '''AppleScript Editor''' icon in the menu bar and click on '''Open Scripts Folder'''. The Scripts folder should open.
 
<br/>
 
<br/>
 
   </p>
 
   </p>
Line 101: Line 85:
 
  <div class="right">
 
  <div class="right">
 
   <p>
 
   <p>
 
+
<br/>
 +
5. Unzip the downloaded scripts and move the whole content to the Scripts folder you just opened.<br/>
 +
<br/>
 +
FYI, the folder is located at<br/>
 +
Macintosh HD > Users > ''your username'' > Library > Scripts
 
<br/>
 
<br/>
 
   </p>
 
   </p>
Line 116: Line 104:
 
  <div class="right">
 
  <div class="right">
 
   <p>
 
   <p>
 
+
6. Click on the '''AppleScript Editor''' icon in the menu bar and click on '''Start_VPNscript'''.<br/>
 
<br/>
 
<br/>
  </p>
+
Setup Complete!<br/>
</div>
+
</div>
+
 
+
 
+
<div class="wrapper">
+
<div class="wrapleft">  
+
  <div class="left">
+
 
+
  </div>
+
</div>   
+
<div class="right">
+
  <p>
+
 
+
 
<br/>
 
<br/>
 
   </p>
 
   </p>
Line 138: Line 113:
  
  
<div class="wrapper">
+
<div class="wrapper"><br/>
<div class="wrapleft">  
+
----
  <div class="left">
+
<br/></div>
 
+
  </div>
+
</div>   
+
<div class="right">
+
  <p>
+
 
+
<br/>
+
  </p>
+
</div>
+
</div>
+
  
  
Line 156: Line 121:
 
  <div class="wrapleft">    
 
  <div class="wrapleft">    
 
   <div class="left">
 
   <div class="left">
 
+
<span class="plainlinks">[https://wiki.btguard.com/images/VPNscript_4.png https://wiki.btguard.com/images/VPNscript_4.png]</span>
 
   </div>
 
   </div>
 
  </div>     
 
  </div>     
Line 162: Line 127:
 
   <p>
 
   <p>
  
<br/>
+
== How To Edit the scripts ==
  </p>
+
</div>
+
</div>
+
 
+
 
+
<div class="wrapper">
+
<div class="wrapleft">  
+
  <div class="left">
+
 
+
  </div>
+
</div>   
+
<div class="right">
+
  <p>
+
  
 +
The following steps are only required if you did not name your VPN connection '''BTGuard VPN''' or if your favorite torrent client isn't listed above.<br/>
 
<br/>
 
<br/>
  </p>
+
1. To edit the script files. Open the AppleScript Editor, click on '''File''' then '''Open...''' <br/>
</div>
+
Locate the scripts you downloaded and open '''Start_VPNscript'''.<br/>
</div>
+
<br/>
 
+
2. To change the name of the VPN connection:<br/>
 
+
Locate '''BTGuard VPN''' and replace it with '''MYVPN''' (or whatever name you've given it). '''Make sure to keep the " "'''.<br/>
<div class="wrapper">
+
<br/>
<div class="wrapleft">  
+
3. To have the script manage a different program, locate '''uTorrent''' and replace it with the name of the program you wish to see closed when the VPN connection drops. <br/>
  <div class="left">
+
 
+
  </div>
+
</div>  
+
<div class="right">
+
  <p>
+
 
+
 
<br/>
 
<br/>
 
   </p>
 
   </p>
Line 201: Line 147:
 
  <div class="wrapleft">    
 
  <div class="wrapleft">    
 
   <div class="left">
 
   <div class="left">
 
+
<span class="plainlinks">[https://wiki.btguard.com/images/VPNscript_5.png https://wiki.btguard.com/images/VPNscript_5.png]</span>
 
   </div>
 
   </div>
 
  </div>     
 
  </div>     
 
  <div class="right">
 
  <div class="right">
 
   <p>
 
   <p>
 
 
<br/>
 
<br/>
  </p>
+
4. Open the second script '''Stop_VPNscript'''.<br/>
</div>
+
<br/>
</div>
+
5. To change the name of the VPN connection:<br/>
 
+
Locate '''BTGuard VPN''' and replace it with '''MYVPN''' (or whatever name you've given it). '''Make sure to keep the " "'''.<br/>
 
+
<br/>
<div class="wrapper">
+
6. To have the script manage a different program, locate '''uTorrent''' and replace it with the name of the program you wish to see closed when the VPN connection drops. <br/>
<div class="wrapleft">  
+
  <div class="left">
+
 
+
  </div>
+
</div>  
+
<div class="right">
+
  <p>
+
 
+
 
<br/>
 
<br/>
 
   </p>
 
   </p>
 
  </div>
 
  </div>
 
</div>
 
</div>

Latest revision as of 04:26, 13 September 2013

VPNscript_1.png

How To use the Auto Reconnect VPN Script for Mac


This script will monitor the status of your VPN connection and will automatically try to reconnect you to the VPN if you're disconnected.

This will also allow you to select a program (uTorrent in this example) that will automatically be shutdown when disconnected and reopened after the VPN reconnected.


VPNscript_2.png

There are some limitations to this script. Once it's started, you CANNOT disconnect from the VPN or close your torrent program as the script will automatically reconnect to the VPN and launch the program. The only way to stop the script is by restarting the computer.


1. First, you'll need to open the AppleScript Editor and go to Preferences.


VPNscript_3.png


2. Make sure Show Script menu in menu bar is checked.

THE FOLLOWING SCRIPTS WILL ONLY WORK IF YOU FOLLOWED THESE INSTRUCTIONS TO THE LETTER FOR THE PPTP METHOD AND YOUR VPN CONNECTION IS PROPERLY NAMED: BTGuard VPN

3. To make things easier, we have created some pre-configured scripts for some torrent clients. Please download the appropriate script depending on the torrent client you use:

If the program you use is not listed above, please scroll down to the How To Edit the scripts section.


VPNscript_6.png

4. Click on the AppleScript Editor icon in the menu bar and click on Open Scripts Folder. The Scripts folder should open.


VPNscript_7.png


5. Unzip the downloaded scripts and move the whole content to the Scripts folder you just opened.

FYI, the folder is located at
Macintosh HD > Users > your username > Library > Scripts


VPNscript_8.png

6. Click on the AppleScript Editor icon in the menu bar and click on Start_VPNscript.

Setup Complete!






VPNscript_4.png

How To Edit the scripts

The following steps are only required if you did not name your VPN connection BTGuard VPN or if your favorite torrent client isn't listed above.

1. To edit the script files. Open the AppleScript Editor, click on File then Open...
Locate the scripts you downloaded and open Start_VPNscript.

2. To change the name of the VPN connection:
Locate BTGuard VPN and replace it with MYVPN (or whatever name you've given it). Make sure to keep the " ".

3. To have the script manage a different program, locate uTorrent and replace it with the name of the program you wish to see closed when the VPN connection drops.


VPNscript_5.png


4. Open the second script Stop_VPNscript.

5. To change the name of the VPN connection:
Locate BTGuard VPN and replace it with MYVPN (or whatever name you've given it). Make sure to keep the " ".

6. To have the script manage a different program, locate uTorrent and replace it with the name of the program you wish to see closed when the VPN connection drops.