### this script works correctly on mandriva 2009 ###
if /sbin/iwconfig | grep -i 'ESSID:"WLAN_11"'; then ### if i am at home
if ping
www.google.es -c 1 | grep -i '1 received'; then
if ping 192.168.1.34 -c 1 | grep -i '1 received'; then ###ping my destop computer
zenity --info --text="Desktop está conectado" ###my desktop computer is running (it's normal having a slow connection)
elif grep "on-line" /proc/acpi/ac_adapter/AC0/state -c; then ### if laptop is plugged
#transmission -m
#azureus
azureus & deluge
#deluge
#amule
#monsoon
fi
elif ping 192.168.1.1 -c 1 | grep -i '1 received'; then ### if my router is up
zenity --info --text="El zyxel no está conectado a internet" ### my router is up but not connected to the internet (needs to restart)
fi
fi