Update mm-scripts.sh

This commit is contained in:
2023-01-22 09:42:23 -06:00
parent 3af1b14fe2
commit 1c9cd7dea4

View File

@@ -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}