adding a test for the REBOOT_PAUSE value (>= 0)

and some code style modification. Sorry about that, I think I have an OCD...
This commit is contained in:
Frédéric Mahé
2019-10-05 18:37:28 +02:00
committed by GitHub
parent 7fee59f581
commit 83c159f6fa

View File

@@ -153,7 +153,7 @@ UNRAR_DEBS_URL="http://http.us.debian.org/debian/pool/non-free/u/unrar-nonfree"
#Uncomment this if you want the script to sync the system date and time with a NTP server
#NTP_SERVER="0.pool.ntp.org"
AUTOREBOOT="true"
REBOOT_PAUSE=0
REBOOT_PAUSE=0 # in seconds
TEMP_PATH="/tmp"
TO_BE_DELETED_EXTENSION="to_be_deleted"
@@ -744,16 +744,14 @@ then
fi
echo "Done!"
if [ $REBOOT_NEEDED == "true" ]
then
if [ $AUTOREBOOT == "true" ]
then
echo "Rebooting in $REBOOT_PAUSE seconds"
sleep $REBOOT_PAUSE
reboot now
else
echo "You should reboot"
fi
if [[ "${REBOOT_NEEDED}" == "true" ]] ; then
if [[ "${AUTOREBOOT}" == "true" && "${REBOOT_PAUSE}" -ge 0 ]] ; then
echo "Rebooting in ${REBOOT_PAUSE} seconds"
sleep "${REBOOT_PAUSE}"
reboot now
else
echo "You should reboot"
fi
fi
exit 0