diff --git a/board/common/overlay/etc/init.d/bootdone b/board/common/overlay/etc/init.d/bootdone index 14ca681cfc..38e16f566b 100755 --- a/board/common/overlay/etc/init.d/bootdone +++ b/board/common/overlay/etc/init.d/bootdone @@ -3,5 +3,5 @@ source /etc/init.d/panic # reset panic counter after a successful boot -echo 0 > ${_PANIC_COUNTER_FILE} +echo 0 > ${PANIC_COUNTER_FILE} diff --git a/board/common/overlay/etc/init.d/panic b/board/common/overlay/etc/init.d/panic index 7a1785188c..4c6c992c20 100644 --- a/board/common/overlay/etc/init.d/panic +++ b/board/common/overlay/etc/init.d/panic @@ -1,19 +1,19 @@ -_PANIC_COUNTER_FILE="/var/lib/panic_counter" -_PANIC_REBOOT_DELAY_FACTOR=10 -_PANIC_REBOOT_DELAY_MAX=3600 # reboot at least once an hour in case of panic +PANIC_COUNTER_FILE="/var/lib/panic_counter" +PANIC_REBOOT_DELAY_FACTOR=10 +PANIC_REBOOT_DELAY_MAX=3600 # reboot at least once an hour in case of panic panic_action() { # read counter from file - panic_counter=$(cat ${_PANIC_COUNTER_FILE} 2>/dev/null || echo 0) + panic_counter=$(cat ${PANIC_COUNTER_FILE} 2>/dev/null || echo 0) # write increased counter back to file - echo $((panic_counter + 1)) > ${_PANIC_COUNTER_FILE} + echo $((panic_counter + 1)) > ${PANIC_COUNTER_FILE} - delay=$((_PANIC_REBOOT_DELAY_FACTOR * panic_counter)) - if [[ "${delay}" -gt "${_PANIC_REBOOT_DELAY_MAX}" ]]; then - delay=${_PANIC_REBOOT_DELAY_MAX} + delay=$((PANIC_REBOOT_DELAY_FACTOR * panic_counter)) + if [[ "${delay}" -gt "${PANIC_REBOOT_DELAY_MAX}" ]]; then + delay=${PANIC_REBOOT_DELAY_MAX} fi if [[ "${delay}" -gt 0 ]]; then