Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Limit Wifi data usage when mobile tethered

If you have a question or need help, this is the place to be.
Post Reply
Barra
Posts: 3
Joined: Fri May 15, 2015 11:44 am

Limit Wifi data usage when mobile tethered

Post by Barra »

Hi Guys,
Does anyone know if EventGhost has the ability to shutdown a program (eg Google Drive) when connected to a specific Wifi access point (eg. specific name of mobile hotspot). I keep forgetting to turn off google drive when tethered in work meetings and have chewed through my mobile data on a number of occasions. The boss has not been happy. Would be great to auto shut google drive.
Dragon470
Experienced User
Posts: 205
Joined: Thu Feb 10, 2011 2:16 am

Re: Limit Wifi data usage when mobile tethered

Post by Dragon470 »

yes you can if you are doing it by SSID. I had a similar situation with bitsync. For googledrivesync.exe you can use this in a script:

Code: Select all

from subprocess import Popen, PIPE, STDOUT, SW_HIDE
import os

#this should get you your current SSID
proc = Popen("netsh wlan show interfaces".split(),stdout = PIPE,stderr = STDOUT,creationflags = SW_HIDE, shell = True)
data = str(proc.stdout.read())
data = data.splitlines()
for line in data:
    if line[4:8] == "SSID":
#        print line
        SSID = line[29:]

if SSID == "Name of work SSID":
    #Now stop googledrivesync.exe
    #This just kills it
    os.system("taskkill /im googledrivesync.exe /f")
Barra
Posts: 3
Joined: Fri May 15, 2015 11:44 am

Re: Limit Wifi data usage when mobile tethered

Post by Barra »

Hi Dragon470,

Thanks for your prompt reply, and I'm glad to see I'm not the only one facing this issue. I am a nube to EventGhost, so if you wouldn't mind are you able to walk me through setting this script up step by step. My email is if that might be easier to do it that way. Any help you can give would be greatly appreciated. (I thought that I might set up a Python Script but that doesn't have seemed to work.)
Dragon470
Experienced User
Posts: 205
Joined: Thu Feb 10, 2011 2:16 am

Re: Limit Wifi data usage when mobile tethered

Post by Dragon470 »

So for setting this up you can use scheludeghost plugin. This is probably the easiest way for someone new.

Load the plugin, setup were to save the scheduleghost setting file, then click on "Show scheduleghost manager"

"Add new" Make one that looks something like this:
schedule setup.jpg
You can change how often you would want it to check.

Apply thru both screens (getting you back to eventghost main screen.
If you did my settings in a little bit a new event will show up the the log.
Click and drag it to the spot of your script. The whole thing should look like this:
script.jpg

I use a much longer and very specific script (bluetooth discovery) for starting/stopping/preventing automated backups.

If you are getting an error in the log about SSID variable is not defined then remove the # from the "print line" Some thing might be wrong in the formatting of the output. You will just have to adjust the line and position of what it grabs.
Barra
Posts: 3
Joined: Fri May 15, 2015 11:44 am

Re: Limit Wifi data usage when mobile tethered

Post by Barra »

Mate that worked brilliantly. Can't thank you enough for your help. You're an absolute ledgend.
Post Reply