[ previous ] [ next ] [ threads ]
 From:  Phill R Kenoyer <phill at bmg50 dot com>
 To:  'M0n0Wall' list <m0n0wall at lists dot m0n0 dot ch>
 Subject:  Remote Reboot?
 Date:  Thu, 27 May 2004 14:35:49 -0700
Does anyone know of a way to do a remote reboot?  I have a script that 
can detect when there are problems with my m0n0wall AP's, but I have to 
manually log in to them and reboot them when it happens.  I'm not too 
happy about being chained to my desk 365 days a year.  The AP's usually 
need to be rebooted at least once per day because of wireless "xmit" 

Here is the script that lets me know there is a problem:

HOSTS="ap1 ap2 ap3"
XMIT_ERROR=`tail -50 /var/log/syslog | grep "xmit failed" | wc -l`

# Test syslog file
if [ $XMIT_ERROR -gt 20 ]
         beep -r 3 -f 900 -l 4000 &
         echo "`date +'%b %d %T'` ********** XMIT ERRORS **********" >> 
         echo "`date +'%b %d %T'` ********** XMIT ERRORS **********" >> 
		# I would like to reboot the AP here.
         echo "Logs OK"