#!/usr/bin/sh
#########################################################
# Orbital Net UBNT Radio Optional Reboot                #
# (c) 2024 Orbital Net Ltd                              #
# Author: Andrew Cassidy <andrew.cassidy@orbital.net>   #
#########################################################

if [ -e /tmp/firmware.lock ]; then
  echo "Firmware upgrade in progress, radio will reboot on completion."
else
  if [ -e /tmp/reboot-required ]; then
    echo "Settings and/or scripts have been updated. Rebooting..."
    reboot
  else
    echo "Reboot not required."
  fi
fi
