This commit is contained in:
2023-05-03 21:32:07 -05:00
parent a6ba65260b
commit 0b76804649
3 changed files with 107 additions and 105 deletions

20
run.sh
View File

@@ -72,7 +72,7 @@ if [ "${1}" == "update" ] || [ "${1}" == "setup" ]; then
else
echo -e "${idsCL[LightCyan]}No Updates Available${idsCL[Default]}"
fi
/bin/rm -f ${MMFOLDER}/update.available
/bin/rm -f ${TMPFOLDER}/update.available
else
echo -e "${idsCL[Red]}Could not connect to 'git.schroedercity.com' for updates${idsCL[Default]}"
@@ -81,21 +81,21 @@ if [ "${1}" == "update" ] || [ "${1}" == "setup" ]; then
fi
if [ "${1}" == "clear" ]; then
[ ! -f ${MMFOLDER}/mm.stop ] && rm -f ${MMFOLDER}/mm.* || rm -f ${MMFOLDER}/mm.*; touch ${MMFOLDER}/mm.stop
[ ! -f ${TMPFOLDER}/mm.stop ] && rm -f ${TMPFOLDER}/mm.* || rm -f ${TMPFOLDER}/mm.*; touch ${TMPFOLDER}/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*
if [ -f ${TMPFOLDER}/mm.stop.checking ]; then
#fd=$(expr $(date +%s) - $(stat -L --format %Y ${TMPFOLDER}/mm.stop.checking))
if [ $(expr $(date +%s) - $(stat -L --format %Y ${TMPFOLDER}/mm.stop.checking)) -gt 900 ]; then
rm -f ${TMPFOLDER}/mm.stop*
elif [ "${1}" = "check" ] && [ "$(ip link | grep "${VPN_INTERFACE}")" = "" ] && [ ! -f ${TMPFOLDER}/mm.vpn* ] && [ $(uptime_minutes) -lt 3 ]; then
rm -f ${TMPFOLDER}/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
if [ ! -f ${TMPFOLDER}/mm.stop.checking ] || [ "${1}" == "status" ] || [ "${1}" == "update-service" ] || [ "${1}" == "update-allservices" ] || [ "${1}" == "stop" ]; then
[ "${1}" == "start" ] && rm -f ${TMPFOLDER}/mm.stop
${MMFOLDER}/mm-scripts.sh ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14}
fi