From 93b89ae39f2d449132cc5bf2ec77c76d8c2e0dd4 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Sun, 16 Jul 2023 00:25:15 +1200 Subject: [PATCH] Remove bashisms --- ChangeLog | 3 +++ bin/mythtv-update-motd | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ae6aa7..94215d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2023-07-16 Andrew Ruthven + Remove bashisms + 2001-02-14 Andrew Ruthven Release version 1.0.2. diff --git a/bin/mythtv-update-motd b/bin/mythtv-update-motd index 2df4d22..fce90c6 100755 --- a/bin/mythtv-update-motd +++ b/bin/mythtv-update-motd @@ -64,8 +64,10 @@ else # If the tempfile is less than 15 minutes old, object, otherwise # we'll assume that something went wrong and remove it. if [ -f $TEMPFILE ]; then - AGE=$(stat -c "%Z" $TEMPFILE); - if (( $AGE > $(date +'%s') - 900 )) + AGE=$(stat -c "%Z" $TEMPFILE); + THRESHOLD=$(( $(date +'%s') - 900 )) + + if [ $AGE -gt $THRESHOLD ] then echo "I think another $NAME is running." exit 1 -- 2.30.2