diff --git a/defaults.inc b/defaults.inc index 67b71cd..67eb98d 100755 --- a/defaults.inc +++ b/defaults.inc @@ -17,6 +17,7 @@ UPDATE_SERVICES=(${UPDATESERVICES}) unset IFS noheader=' check noup update update-organizr ' +allowrun=' status update stop vpninfo ' logfile=${MMFOLDER}/logs/logfile outputlogfile=${MMFOLDER}/logs/outputs.check.log diff --git a/run.sh b/run.sh index 0912da3..a626f50 100755 --- a/run.sh +++ b/run.sh @@ -90,12 +90,12 @@ if [ -f ${TMPFOLDER}/mm.stop.checking ]; then elif [ "${1}" = "check" ] && [ "$(ip link | grep "${VPN_INTERFACE}")" = "" ] && [ ! -f ${TMPFOLDER}/mm.vpn* ] && [ $(uptime_minutes) -lt 3 ]; then rm -f ${TMPFOLDER}/mm.stop* - elif [ "${1}" != "status" ] && [ "${1}" != "update-service" ] && [ "${1}" != "update-allservices" ] && [ "${1}" != "stop" ] && [ "${1}" != "" ]; then + elif [[ "${allowrun}" != *" ${1} "* ]] && [ "${1}" != "" ]; then echo -e "${idsCL[LightCyan]}Try again later, 'mm' program currently in use...${idsCL[Default]}" fi fi -if [ ! -f ${TMPFOLDER}/mm.stop.checking ] || [ "${1}" == "status" ] || [ "${1}" == "update-service" ] || [ "${1}" == "update-allservices" ] || [ "${1}" == "stop" ] || [ "${1}" == "" ]; then +if [ ! -f ${TMPFOLDER}/mm.stop.checking ] || [[ "${allowrun}" == *" ${1} "* ]] || [ "${1}" == "" ]; 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