diff --git a/bin/oref0-radio-reboot.sh b/bin/oref0-radio-reboot.sh index ba8a18423..2718e6749 100755 --- a/bin/oref0-radio-reboot.sh +++ b/bin/oref0-radio-reboot.sh @@ -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