Skip to content

Commit

Permalink
don't extend reboot time every minute
Browse files Browse the repository at this point in the history
  • Loading branch information
scottleibrand committed Feb 23, 2017
1 parent e4c80eb commit 17f38b4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bin/oref0-radio-reboot.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
radio_errors=`tail /var/log/openaps/pump-loop.log | grep "spidev5.1 already in use"`
if [ ! -z "$radio_errors" ]; then
logfile=/var/log/openaps/pump-loop.log
echo >> $logfile
echo -n "Radio error found at " | tee -a $logfile
date >> $logfile
shutdown -r +5 "Rebooting to fix radio errors!" | tee -a $logfile
echo >> $logfile
if [ ! -e /run/nologin ]; then
logfile=/var/log/openaps/pump-loop.log
echo >> $logfile
echo -n "Radio error found at " | tee -a $logfile
date >> $logfile
shutdown -r +5 "Rebooting to fix radio errors!" | tee -a $logfile
echo >> $logfile
fi
else
if [ -e /run/nologin ]; then
echo "No more radio errors; canceling reboot" | tee -a $logfile
Expand Down

0 comments on commit 17f38b4

Please sign in to comment.