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

Loading…
Cancel
Save

Powered by TurnKey Linux.