From a9660616327384260740a25d2896c0eb5d29eb9d Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 25 Feb 2023 16:53:41 -0600 Subject: [PATCH] Update run.sh --- run.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/run.sh b/run.sh index f1822a0..b992462 100755 --- a/run.sh +++ b/run.sh @@ -56,21 +56,23 @@ if [ "${1}" == "update" ]; then else echo -e "${idsCL[Red]}Could not connect to 'git.schroedercity.com' for updates${idsCL[Default]}" fi -fi - -if [ -f /opt/idssys/mediamanager/mm.checking ]; then - fd=$(( `date +%s` - `stat -L --format %Y /opt/idssys/mediamanager/mm.checking` )) - if [ ${fd} -gt 900 ]; then - rm -f /opt/idssys/mediamanager/mm.checking - else - echo -e "${idsCL[LightCyan]}Try again later, 'mm' program currently in use...${idsCL[Default]}" + +else + if [ -f /opt/idssys/mediamanager/mm.checking ]; then + fd=$(( `date +%s` - `stat -L --format %Y /opt/idssys/mediamanager/mm.checking` )) + if [ ${fd} -gt 900 ]; then + rm -f /opt/idssys/mediamanager/mm.checking + else + echo -e "${idsCL[LightCyan]}Try again later, 'mm' program currently in use...${idsCL[Default]}" + fi fi -fi -if [ ! -f /opt/idssys/mediamanager/mm.checking ]; then - touch /opt/idssys/mediamanager/mm.checking - /opt/idssys/mediamanager/mm-scripts.sh ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} + if [ ! -f /opt/idssys/mediamanager/mm.checking ]; then + touch /opt/idssys/mediamanager/mm.checking + /opt/idssys/mediamanager/mm-scripts.sh ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} + fi + fi exit 0