From 40c7e9d775f8455ff77d9f788682afade502e89f Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 29 Apr 2023 22:52:58 -0500 Subject: [PATCH] Update run.sh --- run.sh | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/run.sh b/run.sh index f90dd46..c682b24 100755 --- a/run.sh +++ b/run.sh @@ -82,28 +82,27 @@ if [ "${1}" == "update" ] || [ "${1}" == "setup" ]; then echo -e "${idsCL[Red]}Could not connect to 'git.schroedercity.com' for updates${idsCL[Default]}" fi - -else - if [ "${1}" == "clear" ]; then - [ ! -f ${MMFOLDER}/mm.stop ] && rm -f ${MMFOLDER}/mm.* || rm -f ${MMFOLDER}/mm.*; touch ${MMFOLDER}/mm.stop - fi - if [ -f ${MMFOLDER}/mm.stop.checking ]; then - #fd=$(expr $(date +%s) - $(stat -L --format %Y ${MMFOLDER}/mm.stop.checking)) - if [ $(expr $(date +%s) - $(stat -L --format %Y ${MMFOLDER}/mm.stop.checking)) -gt 900 ]; then - rm -f ${MMFOLDER}/mm.stop* - elif [ "${1}" = "check" ] && [ "$(ip link | grep "${VPN_INTERFACE}")" = "" ] && [ ! -f ${MMFOLDER}/mm.vpn* ] && [ $(uptime_minutes) -lt 3 ]; then - rm -f ${MMFOLDER}/mm.stop* - else - echo -e "${idsCL[LightCyan]}Try again later, 'mm' program currently in use...${idsCL[Default]}" - fi - fi - - if [ ! -f ${MMFOLDER}/mm.stop.checking ] || [ "${1}" == "status" ] || [ "${1}" == "update-service" ] || [ "${1}" == "update-allservices" ] || [ "${1}" == "stop" ]; then - [ "${1}" == "start" ] && rm -f ${MMFOLDER}/mm.stop - ${MMFOLDER}/mm-scripts.sh ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} - fi - fi + +if [ "${1}" == "clear" ]; then + [ ! -f ${MMFOLDER}/mm.stop ] && rm -f ${MMFOLDER}/mm.* || rm -f ${MMFOLDER}/mm.*; touch ${MMFOLDER}/mm.stop +fi +if [ -f ${MMFOLDER}/mm.stop.checking ]; then + #fd=$(expr $(date +%s) - $(stat -L --format %Y ${MMFOLDER}/mm.stop.checking)) + if [ $(expr $(date +%s) - $(stat -L --format %Y ${MMFOLDER}/mm.stop.checking)) -gt 900 ]; then + rm -f ${MMFOLDER}/mm.stop* + elif [ "${1}" = "check" ] && [ "$(ip link | grep "${VPN_INTERFACE}")" = "" ] && [ ! -f ${MMFOLDER}/mm.vpn* ] && [ $(uptime_minutes) -lt 3 ]; then + rm -f ${MMFOLDER}/mm.stop* + else + echo -e "${idsCL[LightCyan]}Try again later, 'mm' program currently in use...${idsCL[Default]}" + fi +fi + +if [ ! -f ${MMFOLDER}/mm.stop.checking ] || [ "${1}" == "status" ] || [ "${1}" == "update-service" ] || [ "${1}" == "update-allservices" ] || [ "${1}" == "stop" ]; then + [ "${1}" == "start" ] && rm -f ${MMFOLDER}/mm.stop + ${MMFOLDER}/mm-scripts.sh ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} +fi + echo exit 0