From: Andrew Ruthven Date: Sat, 15 Jul 2023 12:25:15 +0000 (+1200) Subject: Remove bashisms X-Git-Tag: 1.1.0~33 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93b89ae39f2d449132cc5bf2ec77c76d8c2e0dd4;p=mythtv-status.git Remove bashisms --- 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