This script should disconnect from network (wlan or GPRS/UMTS) after 5 to 10 minutes of no received packets: Code: #!/bin/sh a=`ifconfig phonet0 | grep RX.p | cut -d: -f2` c=`ifconfig wlan0 | grep RX.p | cut -d: -f2` b=$a d=$c while true ; do sleep 300 a=`ifconfig phonet0 | grep RX.p | cut -d: -f2` c=`ifconfig wlan0 | grep RX.p | cut -d: -f2` if [ "$a" == "$b" -a "$c" == "$d" ] ; then dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true fi b=$a d=$c done
#!/bin/sh a=`ifconfig phonet0 | grep RX.p | cut -d: -f2` c=`ifconfig wlan0 | grep RX.p | cut -d: -f2` b=$a d=$c while true ; do sleep 300 a=`ifconfig phonet0 | grep RX.p | cut -d: -f2` c=`ifconfig wlan0 | grep RX.p | cut -d: -f2` if [ "$a" == "$b" -a "$c" == "$d" ] ; then dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true fi b=$a d=$c done