This method seems to work quite well. There was a firmware failure a few minutes ago:
/var/log/messages
Code:
Feb 21 10:00:01 lucidrine syslogd: restart
Feb 21 12:22:47 lucidrine /bsd: wpi0: fatal firmware error
Feb 21 12:22:47 lucidrine /bsd: firmware error log (count=1):
Feb 21 12:22:47 lucidrine /bsd: error type = "SYSASSERT" (0x00000005)
Feb 21 12:22:47 lucidrine /bsd: error data = 0x00000074
Feb 21 12:22:47 lucidrine /bsd: branch link = 0x000008B600000274
Feb 21 12:22:47 lucidrine /bsd: interrupt link = 0x0000032000004EBC
Feb 21 12:22:47 lucidrine /bsd: time = 124235011
Feb 21 12:22:47 lucidrine /bsd: driver status:
Feb 21 12:22:47 lucidrine /bsd: tx ring 0: qid=0 cur=179 queued=1
Feb 21 12:22:47 lucidrine /bsd: tx ring 1: qid=1 cur=0 queued=0
Feb 21 12:22:47 lucidrine /bsd: tx ring 2: qid=2 cur=0 queued=0
Feb 21 12:22:47 lucidrine /bsd: tx ring 3: qid=3 cur=0 queued=0
Feb 21 12:22:47 lucidrine /bsd: tx ring 4: qid=4 cur=27 queued=0
Feb 21 12:22:47 lucidrine /bsd: tx ring 5: qid=5 cur=0 queued=0
Feb 21 12:22:47 lucidrine /bsd: rx ring: cur=3
Feb 21 12:22:47 lucidrine /bsd: 802.11 state 4
Feb 21 12:22:47 lucidrine dhclient[6135]: wpi0 down; exiting
It was detected and the interface was restarted immediately.
/var/log/daemon
Code:
Feb 21 12:18:37 lucidrine ntpd[27581]: peer 38.229.71.1 now invalid
Feb 21 12:22:47 lucidrine ifstated[30239]: changing state to if_offline
Feb 21 12:22:47 lucidrine dhclient[6135]: wpi0 down; exiting
Feb 21 12:23:07 lucidrine ifstated[30239]: changing state to if_online
Feb 21 12:23:07 lucidrine dhclient[14155]: DHCPREQUEST on wpi0 to 255.255.255.255
Feb 21 12:23:07 lucidrine dhclient[14155]: DHCPACK from 192.168.48.1 (00:90:fb:43:57:51)
Feb 21 12:23:07 lucidrine dhclient[14155]: bound to 192.168.49.59 -- renewal in 21600 seconds.
Very nice!