This commit is contained in:
2023-03-07 21:06:34 -06:00
parent 1d95a7630f
commit b0c2649b09
2 changed files with 23 additions and 9 deletions

11
run.sh
View File

@@ -71,15 +71,10 @@ else
rm -f ${MMFOLDER}/mm.*
fi
if [ -f ${MMFOLDER}/mm.stop.checking ] && [ "${1}" != "status" ]; then
fd=$(expr $(date +%s) - $(stat -L --format %Y ${MMFOLDER}/mm.stop.checking))
# if [ -f ${MMFOLDER}/mm.stop.checking ]; then
# rm -f ${MMFOLDER}/mm.stop*
# fi
if [ ${fd} -gt 900 ]; 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* ]; then
elif [ "${1}" = "check" ] && [ "$(ip link | grep "${VPN_INTERFACE}")" = "" ] && [ ! -f ${MMFOLDER}/mm.vpn* ] && [ $(uptime_minutes) -lt 2 ]; then
rm -f ${MMFOLDER}/mm.stop*
else
echo -e "${idsCL[LightCyan]}Try again later, 'mm' program currently in use...${idsCL[Default]}"