summaryrefslogtreecommitdiffstats
path: root/linhes/linhes-system/recordings.cron
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2024-02-07 04:40:30 (GMT)
committerBritney Fransen <brfransen@gmail.com>2024-02-07 04:40:30 (GMT)
commit71530ef38d97dcde0ac4945fad99ab45ffbf2fb1 (patch)
tree9b50c114581b4a5d062baf067eadec71f31aeeae /linhes/linhes-system/recordings.cron
parent8db5d9250e2db3100efb8c66bbac1a45f2871b0b (diff)
downloadlinhes_pkgbuild-71530ef38d97dcde0ac4945fad99ab45ffbf2fb1.zip
linhes_pkgbuild-71530ef38d97dcde0ac4945fad99ab45ffbf2fb1.tar.gz
linhes_pkgbuild-71530ef38d97dcde0ac4945fad99ab45ffbf2fb1.tar.bz2
linhes-system: recordings.cron: simplify mythbackend check
Diffstat (limited to 'linhes/linhes-system/recordings.cron')
-rw-r--r--linhes/linhes-system/recordings.cron8
1 files changed, 3 insertions, 5 deletions
diff --git a/linhes/linhes-system/recordings.cron b/linhes/linhes-system/recordings.cron
index 387910f..d71c139 100644
--- a/linhes/linhes-system/recordings.cron
+++ b/linhes/linhes-system/recordings.cron
@@ -1,15 +1,13 @@
#!/bin/bash
-#START=$(date +%s)
-
#check if mythbackend is running and was just started
for i in 1 2
do
-if [ `ps -ef | grep mythbackend |grep -v "grep" | wc -l` ]
+if [ $(pidof mythbackend) ]
then
now=$(date +%s)
- mythbackendStartTime=`systemctl status mythbackend.service | grep Active| cut -d ' ' -f 11-12`
- mythbackendStartTime=`date -d"$mythbackendStartTime" +"%s"`
+ mythbackendStartTime=$(systemctl status mythbackend.service | grep Active| cut -d ' ' -f 11-12)
+ mythbackendStartTime=$(date -d"$mythbackendStartTime" +"%s")
if [[ $(( $now - $mythbackendStartTime )) -lt 59 ]]
then
#echo "mythbackend started less than a minute ago. Sleeping..."