|
2010-02-07
, 23:35
|
Posts: 43 |
Thanked: 32 times |
Joined on Jan 2010
|
#92
|
I replaced phonet0 with gprs0 and set it the timeout to 180 seconds and it works great!
ifconfig wlan0 | grep RX.p | cut -d: -f2
-sh: ifconfig: not found
ifconfig wlan0 | grep RX.p | cut -d: -f2
ifconfig wlan0 | grep RX.p | cut -d: -f2
|
2010-02-08
, 00:30
|
Posts: 43 |
Thanked: 32 times |
Joined on Jan 2010
|
#93
|
Could someone do 3G compatible version of this. Change wlan0>gprs0 etc. and edit cuts?
Maybe this script should run only when connected like this /etc/networks/if-pre-up.d/ or /etc/networks/if-up.d/
to start every time a network interface is upped.
And someone should make simple control panel applet to turn this script on/off. Like wifi-switcher check the source code.
#!/bin/sh while true; do sleep 180 a=`tail -1 /proc/net/route | cut -f1` while [ "$a" != "Iface" ] do b=`ifconfig wlan0 | grep RX.p | cut -d"(" -f1 | cut -d: -f2` c=`expr $b + 1000` sleep 180 b=`ifconfig wlan0 | grep RX.p | cut -d"(" -f1 | cut -d: -f2` a=`tail -1 /proc/net/route | cut -f1` if [ "$b" -lt "$c" -a "$a" != "Iface" ]; then dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true sleep 10 a=`tail -1 /proc/net/route | cut -f1` fi done done
|
2010-02-08
, 11:56
|
Posts: 241 |
Thanked: 69 times |
Joined on Dec 2009
@ Germany
|
#94
|
|
2010-02-08
, 12:16
|
Posts: 18 |
Thanked: 14 times |
Joined on Jan 2010
|
#95
|
|
2010-02-08
, 13:07
|
Posts: 43 |
Thanked: 32 times |
Joined on Jan 2010
|
#96
|
@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?
|
2010-02-09
, 06:17
|
Posts: 43 |
Thanked: 32 times |
Joined on Jan 2010
|
#97
|
@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?
|
2010-02-09
, 09:20
|
Posts: 241 |
Thanked: 69 times |
Joined on Dec 2009
@ Germany
|
#98
|
|
2010-02-09
, 09:48
|
Posts: 173 |
Thanked: 160 times |
Joined on Jan 2010
@ London, UK
|
#99
|
|
2010-02-09
, 11:41
|
Posts: 17 |
Thanked: 14 times |
Joined on Jan 2010
@ London, UK
|
#100
|
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.
Thread Tools | |
|
OpenWatch - Bluetooth watch support in Maemo