|
||||||||
OK, here is what I have so far: (Requires m0n0-shellpack) <shellcmd>while /bin/sleep 120; do if [ "`/usr/bin/grep -ca "xmit failed" /var/log/system.log`" -gt 20 ]; then /sbin/reboot; fi; if test "`/sbin/ping -nqc2 63.192.118.1 | /usr/bin/grep "packets" | /usr/bin/sed "s/.*,.*, \(.*\)/\1/"`" = "100% packet loss"; then /sbin/reboot; fi; done</shellcmd> I found out a few things about this shell command and m0n0wall. 1. I can't format the script with line breaks. m0n0 stops at line breaks. 2. I can't figure out how to put it into the background. When I use "&" at the end it really messes things up (xml parse error/crash). & at the end doesn't do anything. It seems to work OK though. Every few minutes it will test the log files and ping the router. If either fail then it will reboot the box. I can boot it up, surf a bit, pull the antenna off and wait 120 sec and it will reboot the box. So it seems to be working. I still need to test it with the xmit errors though. I have a similar script that runs on my router to detect the xmit errors and page me. I should write an extension that is configurable from the GUI to do this stuff. Maybe a shell script that can be saved in the config.xml file. > * Phill R Kenoyer <phill at bmg50 dot com> wrote: > >> I did a test this morning on m0n0wall to see if the wifi bug still >> exists in the hostap mode drivers. It does. >> >> Nov 26 03:11:18 ap2 /kernel: wi1: timeout in wi_seek to 1e3/0; last >> status 81e3 >> Nov 26 03:11:18 ap2 /kernel: wi1: timeout in wi_seek to 15e/3c; last >> status 8000 >> Nov 26 03:11:18 ap2 /kernel: wi1: timeout in wi_cmd 0x010b; event >> status 0x0000 >> Nov 26 03:11:18 ap2 /kernel: wi1: xmit failed >> Nov 26 03:11:18 ap2 /kernel: wi1: wi_cmd: busy bit won't clear. >> Nov 26 03:11:18 ap2 /kernel: wi1: xmit failed >> Nov 26 03:16:24 ********** netcheck: ap2 DOWN! ********** >> >> If your connected to m0n0wall using wirelss 802.11b and put your >> client >> wifi card into "power save mode" then the wifi card on m0n0wall will >> lockup. The only way I know of to fix this is to have m0n0wall reboot >> when the error is detected. > > Did you try <shellcmd> ? > |