lint: fix issues reported by newer shellcheck / shfmt

This commit is contained in:
Benoit Pierre
2024-06-15 22:54:32 +02:00
committed by Frans de Jonge
parent c6f5db0f9e
commit 088ae7d4ee
8 changed files with 17 additions and 21 deletions

View File

@@ -23,4 +23,3 @@ mount -o "${MOUNT_ARGS}" -t vfat "${PARTITION}" /mnt/onboard
PARTITION=${DISK}1p1
[ -e "${PARTITION}" ] && mount -o "${MOUNT_ARGS}" -t vfat "${PARTITION}" /mnt/sd

View File

@@ -1,4 +1,3 @@
#! /bin/sh
echo 0 >/sys/power/state-extended

View File

@@ -12,4 +12,3 @@ sync
# Suspend to RAM.
echo mem >/sys/power/state

View File

@@ -28,4 +28,3 @@ done
export -n KO_MULTIUSER
exit ${RETURN_VALUE}

View File

@@ -118,7 +118,7 @@ while [ "${RETURN_VALUE}" -ne 0 ]; do
if [ "${RETURN_VALUE}" -ne 0 ] && [ "${RETURN_VALUE}" -ne ${KO_RC_RESTART} ]; then
# Increment the crash counter
# shellcheck disable=SC2003
CRASH_COUNT="$(expr ${CRASH_COUNT} + 1)"
CRASH_COUNT="$(expr "${CRASH_COUNT}" + 1)"
CRASH_TS="$(date +'%s')"
# Reset it to a first crash if it's been a while since our last crash...
# shellcheck disable=SC2003
@@ -148,7 +148,7 @@ while [ "${RETURN_VALUE}" -ne 0 ]; do
bombMargin="$(expr ${FONTH} + ${FONTH} / 2)"
# With a little notice at the top of the screen, on a big gray screen of death ;).
"${KOREADER_DIR}/fbink" -q -b -c -B GRAY9 -m -y 1 "Don't Panic! (Crash n°${CRASH_COUNT} -> ${RETURN_VALUE})"
if [ ${CRASH_COUNT} -eq 1 ]; then
if [ "${CRASH_COUNT}" -eq 1 ]; then
# Warn that we're sleeping for a bit...
"${KOREADER_DIR}/fbink" -q -b -O -m -y 2 "KOReader will restart in 15 sec."
fi
@@ -168,13 +168,13 @@ while [ "${RETURN_VALUE}" -ne 0 ]; do
echo "!!!!"
echo "Uh oh, something went awry... (Crash n°${CRASH_COUNT}: $(date +'%x @ %X'))"
} >>crash.log 2>&1
if [ ${CRASH_COUNT} -lt 5 ] && [ "${ALWAYS_ABORT}" = "false" ]; then
if [ "${CRASH_COUNT}" -lt 5 ] && [ "${ALWAYS_ABORT}" = "false" ]; then
echo "Attempting to restart KOReader . . ." >>crash.log 2>&1
echo "!!!!" >>crash.log 2>&1
fi
# Pause a bit if it's the first crash in a while, so that it actually has a chance of getting noticed ;).
if [ ${CRASH_COUNT} -eq 1 ]; then
if [ "${CRASH_COUNT}" -eq 1 ]; then
sleep 15
fi
# Cycle the last crash timestamp
@@ -182,7 +182,7 @@ while [ "${RETURN_VALUE}" -ne 0 ]; do
# But if we've crashed more than 5 consecutive times, exit, because we wouldn't want to be stuck in a loop...
# NOTE: No need to check for ALWAYS_ABORT, CRASH_COUNT will always be 1 when it's true ;).
if [ ${CRASH_COUNT} -ge 5 ]; then
if [ "${CRASH_COUNT}" -ge 5 ]; then
echo "Too many consecutive crashes, aborting . . ." >>crash.log 2>&1
echo "!!!! ! !!!!" >>crash.log 2>&1
break