diff options
Diffstat (limited to 'linhes/linhes-system/recordings.cron')
-rw-r--r-- | linhes/linhes-system/recordings.cron | 8 |
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..." |