system make beep when unplug cable

I have two lan card.
can I do something like this
when cable unplug system make beep and I understand cable is unplug .
I use Thunderbird for read and write email . when new email is coming I hear beep from speaker of mainboard and after that I see notification about new email in KDE 4.
can this happen for unplug cable ?
 
you need script to check your gateway and if no response "beep".
p.s. a thought we agree about "there's no answer" and those like that?
 
Well seriously this is not an elegant way of doing it. But if you really need one for now.. here you go.

Code:
#!/bin/sh

while :;do

bips=`ifconfig rl0 | grep status | awk {'print $2'}`

case ${bips} in
"active")
sleep 30
;;
*)
xkbbell
sleep 2
;;
esac

done

Of course, replace rl0 with your own interface (am assuming you're using one NIC). And xkbbell can be replaced with other sound, say.. /bin/cat /usr/local/share/supertux/sounds/squish.wav > /dev/dsp.

Anyhoo, adjust the script to your needs (if you're planning to use it).

Just run the script with & so it runs as a background process. When you plug out the cable it'll beep, when you plug it back it'll go quiet.
 
I use thunderbird , and when new email is come , I hear sound like beep from onboard speaker from mainboard.
 
Back
Top