Update mm-scripts.sh
This commit is contained in:
@@ -269,7 +269,6 @@ MMSTART(){
|
|||||||
sleep 2s
|
sleep 2s
|
||||||
|
|
||||||
files=$(shopt -s nullglob dotglob; echo ${PLEX_MOUNT}/*)
|
files=$(shopt -s nullglob dotglob; echo ${PLEX_MOUNT}/*)
|
||||||
echo "HERE: $files"
|
|
||||||
if (( ! ${#files} )); then
|
if (( ! ${#files} )); then
|
||||||
if [ -f ${MMFOLDER}/mm.plexmount.fail ]; then
|
if [ -f ${MMFOLDER}/mm.plexmount.fail ]; then
|
||||||
fd=$(( `date +%s` - `stat -L --format %Y ${MMFOLDER}/mm.plexmount.fail` ))
|
fd=$(( `date +%s` - `stat -L --format %Y ${MMFOLDER}/mm.plexmount.fail` ))
|
||||||
@@ -294,11 +293,12 @@ MMSTART(){
|
|||||||
|
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[Green]}Mounted, fixed${idsCL[Default]}"
|
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
|
echo "$(date) - Plex Media now mounted, stopping services to restart them" >> $logfile
|
||||||
for srvc in "${SERVICES_CHECK[@]}"; do
|
for srvc in "${SERVICES_CHECK[@]}"; do
|
||||||
/bin/systemctl stop ${srvc} >/dev/null 2>&1 &
|
/bin/systemctl stop ${srvc} >/dev/null 2>&1 &
|
||||||
done
|
done
|
||||||
|
rm -f ${MMFOLDER}/mm.plexmount.fail*
|
||||||
fi
|
fi
|
||||||
elif [ -f ${MMFOLDER}/mm.plexmount.fail2 ]; then
|
elif [ -f ${MMFOLDER}/mm.plexmount.fail2 ]; then
|
||||||
mount -a >/dev/null 2>&1
|
mount -a >/dev/null 2>&1
|
||||||
@@ -307,7 +307,12 @@ MMSTART(){
|
|||||||
else
|
else
|
||||||
echo -e "${idsCL[Green]}Mounted${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Mounted${idsCL[Default]}"
|
||||||
if [ -f ${MMFOLDER}/mm.plexmount.fail* ]; then
|
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
|
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*
|
rm -f ${MMFOLDER}/mm.plexmount.fail*
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user