#!/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