Update config only reboot in -B if changes

beta-cc-safe
Alan Johnston 2 years ago committed by GitHub
parent f311f1f076
commit 3c090c5285
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -501,25 +501,32 @@ elif [ "$1" = "-B" ]; then
read saver
echo
reboot = 0
if [ "$saver" = "y" ] || [ "$saver" = "yes" ] ; then
echo "Safe Mode! Battery saver mode is now ON"
touch /home/pi/CubeSatSim/battery_saver
# if [ "$mode" = "0" ] ; then sudo systemctl restart rpitx
if [ "$mode" = "0" ] ; then
reboot = 1
fi
else
echo "Safe Mode is OFF. Battery saver mode is now OFF"
if [ "$mode" = "1" ] ; then
sudo rm /home/pi/CubeSatSim/battery_saver
reboot = 1
fi
fi
value=`cat /home/pi/CubeSatSim/.mode`
echo "$value" > /dev/null
set -- $value
if [ "$reboot" = "1" ] ; then
value=`cat /home/pi/CubeSatSim/.mode`
echo "$value" > /dev/null
set -- $value
if [ "$1" = "a" ] || [ "$1" = "s" ] || [ "$1" = "m" ] ; then
echo "rebooting"
# sudo systemctl restart cubesatsim
sudo reboot now
if [ "$1" = "a" ] || [ "$1" = "s" ] || [ "$1" = "m" ] ; then
echo "rebooting"
# sudo systemctl restart cubesatsim
sudo reboot now
fi
fi
elif [ "$1" = "-q" ]; then

Loading…
Cancel
Save

Powered by TurnKey Linux.