Update mm-scripts.sh

This commit is contained in:
2023-04-23 18:27:02 -05:00
parent bb57c945f8
commit b308fc686d

View File

@@ -269,7 +269,6 @@ MMSTART(){
sleep 2s
files=$(shopt -s nullglob dotglob; echo ${PLEX_MOUNT}/*)
echo "HERE: $files"
if (( ! ${#files} )); then
if [ -f ${MMFOLDER}/mm.plexmount.fail ]; then
fd=$(( `date +%s` - `stat -L --format %Y ${MMFOLDER}/mm.plexmount.fail` ))
@@ -294,11 +293,12 @@ MMSTART(){
else
echo -e "${idsCL[Green]}Mounted, fixed${idsCL[Default]}"
rm -f ${MMFOLDER}/mm.plexmount.fail*
SENDNOTICE "Plex Media Mounted" "The Plex Media Folder was successfully re-mounted again!" 1
echo "$(date) - Plex Media now mounted, stopping services to restart them" >> $logfile
for srvc in "${SERVICES_CHECK[@]}"; do
/bin/systemctl stop ${srvc} >/dev/null 2>&1 &
done
rm -f ${MMFOLDER}/mm.plexmount.fail*
fi
elif [ -f ${MMFOLDER}/mm.plexmount.fail2 ]; then
mount -a >/dev/null 2>&1
@@ -307,7 +307,12 @@ MMSTART(){
else
echo -e "${idsCL[Green]}Mounted${idsCL[Default]}"
if [ -f ${MMFOLDER}/mm.plexmount.fail* ]; then
echo -e "${idsCL[Green]}Mounted, fixed${idsCL[Default]}"
SENDNOTICE "Plex Media Mounted" "The Plex Media Folder was successfully re-mounted again!" 1
echo "$(date) - Plex Media now mounted, stopping services to restart them" >> $logfile
for srvc in "${SERVICES_CHECK[@]}"; do
/bin/systemctl stop ${srvc} >/dev/null 2>&1 &
done
rm -f ${MMFOLDER}/mm.plexmount.fail*
fi
fi