Update run.sh

This commit is contained in:
2023-04-29 22:52:58 -05:00
parent 83a4fa9f68
commit 40c7e9d775

41
run.sh
View File

@@ -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