Jump to content

Script to stop transfers, not close the program, when VPN down


g3nius

Recommended Posts

Hey so like the topic says I am working on a script that will stop all the transfers when my VPN goes down. Currently the program is set to quit (but this takes a while) This is not my code and was changed from https://forum.transmissionbt.com/viewtopic.php?f=4&t=12330&p=56986&hilit=script+to+quit+vpn#p56986

on idle
set activeInterfaces to do shell script "ifconfig -lu"
if activeInterfaces = "lo0 en0 en1 fw0 utun0" then
tell application "uTorrent" to quit
tell application "Growl"
notify with name ¬
"VPN Down" title ¬
"VPN Down" description ¬
"I have quit uTorrent." application name "Drop BitTorrent"
end tell
end if
return 5 -- 30 is default value, but it doesn't hurt to include it here
end idle

Does any one know what command I could substitute for the line: ??

tell application "uTorrent" to quit

stop doesn't seem to work and I can't really guess. I also can't seem to find a key command to start/stop transfers

Also what would I add to reenable the transfers?

something like:

if activeInterfaces = "lo0 en0 en1 fw0 utun0 tun0"
tell application "uTorrent" to start (or something to that effect)
if activeInterfaces = "lo0 en0 en1 fw0 tun0 utun0"
tell application "uTorrent" to start (or something to that effect)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...