@ -266,6 +266,7 @@ CRASH_PREV_TS=0
# List of supported special return codes
KO_RC_RESTART = 85
KO_RC_USBMS = 86
KO_RC_HALT = 88
# Because we *want* an initial fbdepth pass ;).
RETURN_VALUE = ${ KO_RC_RESTART }
while [ ${ RETURN_VALUE } -ne 0 ] ; do
@ -282,7 +283,7 @@ while [ ${RETURN_VALUE} -ne 0 ]; do
RETURN_VALUE = $?
# Did we crash?
if [ ${ RETURN_VALUE } -ne 0 ] && [ ${ RETURN_VALUE } -ne ${ KO_RC_RESTART } ] && [ ${ RETURN_VALUE } -ne ${ KO_RC_USBMS } ] ; then
if [ ${ RETURN_VALUE } -ne 0 ] && [ ${ RETURN_VALUE } -ne ${ KO_RC_RESTART } ] && [ ${ RETURN_VALUE } -ne ${ KO_RC_USBMS } ] && [ ${ RETURN_VALUE } -ne ${ KO_RC_HALT } ] ; then
# Increment the crash counter
CRASH_COUNT = $(( CRASH_COUNT + 1 ))
CRASH_TS = $( date +'%s' )
@ -441,6 +442,11 @@ while [ ${RETURN_VALUE} -ne 0 ]; do
fi
rm -rf " ${ USBMS_HOME } "
fi
# Did we request a reboot/shutdown?
if [ ${ RETURN_VALUE } -eq ${ KO_RC_HALT } ] ; then
break
fi
done
# Restore original fb bitdepth if need be...
@ -458,6 +464,8 @@ if [ -n "${ORIG_CPUFREQ_GOV}" ]; then
echo " ${ ORIG_CPUFREQ_GOV } " >"/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
fi
# If we requested a reboot/shutdown, no need to bother with this...
if [ ${ RETURN_VALUE } -ne ${ KO_RC_HALT } ] ; then
if [ " ${ VIA_NICKEL } " = "true" ] ; then
if [ " ${ FROM_KFMON } " = "true" ] ; then
# KFMon is the only launcher that has a toggle to either reboot or restart Nickel on exit
@ -480,6 +488,7 @@ else
/sbin/reboot
fi
fi
fi
# Wipe the clones on exit
rm -f "/tmp/koreader.sh"