From b42c5a107dbfde42ff10aad8f9edc828e557bef5 Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Wed, 1 Jan 2025 02:42:15 -0500
Subject: linhes-system: lh_mtc.cron: don't optimize or backup on desktop

---
 linhes/linhes-system/PKGBUILD    |  4 ++--
 linhes/linhes-system/lh_mtc.cron | 24 +++++++++++++++---------
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/linhes/linhes-system/PKGBUILD b/linhes/linhes-system/PKGBUILD
index d220859..953ba20 100755
--- a/linhes/linhes-system/PKGBUILD
+++ b/linhes/linhes-system/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=linhes-system
 pkgver=9.0.0
-pkgrel=81
+pkgrel=82
 arch=('x86_64')
 #install=$pkgname.install
 pkgdesc="Everything that makes LinHES a system"
@@ -60,7 +60,7 @@ sha256sums=('e6eaa2fb4819fa60cb05b4d2e7328d2914af3a73028a735ec4d56e7ece33ecc0'
             'a961cfdc6f02b12fb445777dd2c144fed96306ca2f430cc8853ae307c759c1ad'
             'd8574104b75c6d41284488612ec5583c50a8dab438492fa42c47231add4cfc54'
             '6bdbf593d3e1348d1a8f7c4c17cb2e893f7e18ae355daf978173e669cfe3be80'
-            'b3f02ec3f8cedc98c74b3169049b7b6aa78bd79d558a8bc98d00e064b983965c'
+            'bc6b23e799f22fa16cfc37a91a5f06503beb80db3eeb420c766f7b3d41ba8356'
             '186203d3c0520bb3d611da99d33a7713e9c1563814285f1f101097234f214b2f'
             'd8d36a501928d0cc505957d392291fad317b1e895ff99847d90643cf5f622a89'
             'cdfc0c836b8194f631f4a9e022c232ff75a13ff1a161a1a011858578bea5f930'
diff --git a/linhes/linhes-system/lh_mtc.cron b/linhes/linhes-system/lh_mtc.cron
index b556d60..75610b5 100644
--- a/linhes/linhes-system/lh_mtc.cron
+++ b/linhes/linhes-system/lh_mtc.cron
@@ -32,11 +32,8 @@ then
 
     if ! grep -q "Finished Optimize" $logFile
     then
-        if [ $SystemType = FrontendOnly ]
+        if [ $SystemType = MasterBackend ]
         then
-            echo "Will not run Optimize on Frontend Only systems." | $log
-            echo "Finished Optimize" | $log
-        else
             sudo -u mythtv bash -c "MYTHCONFDIR=/usr/share/mythtv unbuffer lh_mtc.py --optimize | $log"
             if [ $? = 0 ]
             then
@@ -45,18 +42,27 @@ then
                 echo "Time Exceeded" | $log
                 exit
             fi
+        else
+            echo "Will not run Optimize on Frontend or Desktop Only systems." | $log
+            echo "Finished Optimize" | $log
         fi
     fi
 
     if ! grep -q "Finished Backup" $logFile && grep -q "Finished Optimize" $logFile
     then
-        sudo -u mythtv bash -c "MYTHCONFDIR=/usr/share/mythtv unbuffer lh_mtc.py --backup | $log"
-        if [ $? = 0 ]
+        if [ $SystemType != DesktopOnly ]
         then
-            echo "" | $log
+            sudo -u mythtv bash -c "MYTHCONFDIR=/usr/share/mythtv unbuffer lh_mtc.py --backup | $log"
+            if [ $? = 0 ]
+            then
+                echo "" | $log
+            else
+                echo "Time Exceeded" | $log
+                exit
+            fi
         else
-            echo "Time Exceeded" | $log
-            exit
+            echo "Will not run Backup on Desktop Only systems." | $log
+            echo "Finished Backup" | $log
         fi
     fi
 
-- 
cgit v0.12

