aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorVasyl Gello <vasek.gello@gmail.com>2022-12-12 15:54:11 +0000
committerVasyl Gello <vasek.gello@gmail.com>2022-12-31 08:42:11 +0200
commitfe42d519b8b771149e458b5be553e7303e6a56a4 (patch)
treed20a020bd082391ad47aaeb32362e4f3b4e1ca33 /tools
parentff616328c21bcb062eb21bbde84d3cca027f61f5 (diff)
Get rid of bashisms in kodi*.sh
Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/Linux/kodi-standalone.sh.in8
-rw-r--r--tools/Linux/kodi.sh.in4
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/Linux/kodi-standalone.sh.in b/tools/Linux/kodi-standalone.sh.in
index dc902b4d7e..956e193864 100644
--- a/tools/Linux/kodi-standalone.sh.in
+++ b/tools/Linux/kodi-standalone.sh.in
@@ -30,21 +30,21 @@ LOOP=1
CRASHCOUNT=0
LASTSUCCESSFULSTART=$(date +%s)
-while [ $(( $LOOP )) = "1" ]
+while [ $LOOP -eq 1 ]
do
$APP
RET=$?
NOW=$(date +%s)
- if [ $(( ($RET >= 64 && $RET <=66) || $RET == 0 )) = "1" ]; then # clean exit
+ if [ $RET -ge 64 ] && [ $RET -le 66 ] || [ $RET -eq 0 ]; then # clean exit
LOOP=0
else # crash
DIFF=$((NOW-LASTSUCCESSFULSTART))
- if [ $(($DIFF > 60 )) = "1" ]; then # Not on startup, ignore
+ if [ $DIFF -gt 60 ]; then # Not on startup, ignore
LASTSUCESSFULSTART=$NOW
CRASHCOUNT=0
else # at startup, look sharp
CRASHCOUNT=$((CRASHCOUNT+1))
- if [ $(($CRASHCOUNT >= 3)) = "1" ]; then # Too many, bail out
+ if [ $CRASHCOUNT -ge 3 ]; then # Too many, bail out
LOOP=0
echo "${APP} has exited in an unclean state 3 times in the last ${DIFF} seconds."
echo "Something is probably wrong"
diff --git a/tools/Linux/kodi.sh.in b/tools/Linux/kodi.sh.in
index 108c0b007b..11cace29a5 100644
--- a/tools/Linux/kodi.sh.in
+++ b/tools/Linux/kodi.sh.in
@@ -180,10 +180,10 @@ do
CHILD=$!
wait "${CHILD}"
RET=$?
- if [ $(( $RET == 65 )) = "1" ]
+ if [ $RET -eq 65 ]
then # User requested to restart app
LOOP=1
- elif [ $(( ($RET >= 131 && $RET <= 136) || $RET == 139 )) = "1" ]
+ elif [ $RET -ge 131 ] && [ $RET -le 136 ] || [ $RET -eq 139 ]
then # Crashed with core dump
print_crash_report
fi