From 1c9cd7dea4b75636bcdde9861e14eec8a3f44116 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 22 Jan 2023 09:42:23 -0600 Subject: [PATCH] Update mm-scripts.sh --- mm-scripts.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/mm-scripts.sh b/mm-scripts.sh index 374dbd5..4700bd3 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -185,6 +185,36 @@ MMSTART(){ exit 1 fi + + ### CHECK FOR PLEX MOUNT + files=$(shopt -s nullglob dotglob; echo ${PLEX_MOUNT}/*) + if (( ! ${#files} )); then + umount ${PLEX_MOUNT} + mount -a + + files=$(shopt -s nullglob dotglob; echo ${PLEX_MOUNT}/*) + if (( ! ${#files} )); then + if [ -f /opt/idssys/mediamanager/mm.plexmount.fail ]; then + fd=$(( `date +%s` - `stat -L --format %Y /opt/idssys/mediamanager/mm.plexmount.fail` )) + if [ ${fd} -gt 3600 ]; then + PMFS=true + rm -f /opt/idssys/mediamanager/mm.plexmount.fail + else + PMFS=false + fi + else + PMFS=true + fi + + if [ "${EMAIL_NOTICE}" != "" ] && [ ${PMFS} = true ]; then + echo "Could not mount the Plex Media Folder" | mail -s "Plex Media Not Mounted" ${EMAIL_NOTICE} + touch /opt/idssys/mediamanager/mm.plexmount.fail + fi + fi + fi + + + echo -en "${idsCL[LightCyan]}${mmsv} Services... ${idsCL[Default]}" for srvc in "${SERVICES_CHECK[@]}"; do /bin/systemctl start ${srvc}