![]() |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
Code:
ifconfig wlan0 | grep RX.p | cut -d: -f2 Code:
-sh: ifconfig: not found Get connected again. Now, gain root and type: Code:
ifconfig wlan0 | grep RX.p | cut -d: -f2 If you run the script as root you don't get any errors but you also don't get disconnected. To find out why, open another terminal and run (as root). Code:
ifconfig wlan0 | grep RX.p | cut -d: -f2 |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
Code:
#!/bin/sh |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
@azstund,
I tested your modified script and at first after bootup it disconnected me correctly. Then I tested if it leaves a used connection unchanged by listening to internet radio streams. The script did not disconnect, fine. Afterwards i closed all programs causing traffic and waited for a disconnect, but nothing happens. Can you figure out whats wrong? |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
I would rather attach it to the cron: http://talk.maemo.org/showthread.php?p=467732 with 3 minutes period instead of global while true...
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
EDIT: Another thing, what time did you set for sleep and how much time did you wait for a disconnection after closing all programs? |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
ok, good I was to lazy yesterday to set up the test :)
But is you Script in post #93 affecting packet connection over 3G, GPRS? I just want to disconnect WLAN, hence I don't think I can idle in ICQ when on 3G anymore if I use Script #93. |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
I wrote a script for /etc/network/if-up.d/ a number of weeks back to check whether the slide was shut, whether ssh was running (rarely want disconnect in this case) and if so, disconnect. It exited if no route was up. Sorting idled bytes xfered was the missing piece, thanks for this thread! I can post my script if ppl are interested.
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
Also, when I connect to a network the email app automatically checks for new emails. If the script could also automatically bring an interface up intermittently (then normal logic to bring it down) would email be checked? This would be perfect - long battery life plus email notifications. I would also like to be able to bring down openvpn when on my home wifi connection. It looks like this thread might make this possible too... |
All times are GMT. The time now is 05:04. |
vBulletin® Version 3.8.8