Update mm-scripts.sh

This commit is contained in:
2023-07-10 19:21:28 -05:00
parent 77c73ba251
commit 1709be5d83

View File

@@ -182,9 +182,13 @@ MMSTART(){
echo "$(date) - 24hr session limit reached, restarting vpn & services" >> ${MM_LOGFILE}
echo -en "${idsCL[LightCyan]}24hr session limit reached, restarting vpn & services"
else
# $(date -d@${MM_VPN_RESTART} -u "+%H hr(s), %M min(s) & %S sec(s)")'
sessiontimeout=$(date -d@${MM_VPN_RESTART} -u "+%H%--%M%--%S%-")
IFS='-'; read -a session_timeout <<< "${sessiontimeout}"; unset IFS
sessiontimeout="${session_timeout[0]} hr"
[ ${session_timeout[1]} -gt 0 ] && sessiontimeout="${sessiontimeout}, ${session_timeout[1]} min"
[ ${session_timeout[2]} -gt 0 ] && sessiontimeout="${sessiontimeout}, ${session_timeout[2]} sec"
echo "$(date) - Your '$(date -d@${MM_VPN_RESTART} -u "+%H hr(s), %M min(s) & %S sec(s)")' session limit reached, restarting vpn & services" >> ${MM_LOGFILE}
echo "$(date) - Your '${sessiontimeout}' session limit reached, restarting vpn & services" >> ${MM_LOGFILE}
echo -en "${idsCL[LightCyan]}24hr session limit reached, restarting vpn & services"
fi
[ -f ${TMPFOLDER}/mm.noservices ] && rv="vpn" || rv=""