Welcome to Media Center Master!
A powerful solution for mastering your digital media library.
Supporting Emby, Kodi/XBMC/OSMC, Plex, Windows Media Center, and more!

Home Download Gallery Wiki Issue Tracker Licensing Forums

   FAQ  •  Search •  Login •  Register     
It is currently September 17th, 2019, 4:18 am

All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Check NAS before processing
PostPosted: June 4th, 2018, 5:39 am 
Offline
Downloaded Clip

Joined: March 14th, 2012, 5:20 am
Posts: 6
Hi there,

Would it be possible to add an option to check NAS I.P address is responding to ping before running any further automation processes?


 Profile  
 Post subject: Re: Check NAS before processing
PostPosted: May 8th, 2019, 1:58 pm 
Offline
Downloaded Clip

Joined: March 26th, 2018, 7:49 am
Posts: 7
+1

I have come home from travel a few times to find my MCM box (laptop w/battery) has redownloaded many seasons of files because my NAS shut down during a power outage and did not come back up.


 Profile  
 Post subject: Re: Check NAS before processing
PostPosted: July 30th, 2019, 12:24 pm 
Offline
Downloaded Clip

Joined: July 30th, 2019, 12:22 pm
Posts: 6
How about as a workaround for now setting your download folder path as on your nas box? that way if its offline it wont be able to download anything.


 Profile  
 Post subject: Re: Check NAS before processing
PostPosted: July 30th, 2019, 12:37 pm 
Offline
Developer/Owner
User avatar

Joined: May 1st, 2009, 10:12 am
Posts: 11610
Location: Meridian, ID, USA
It'd be fairly trivial to just shut down Media Center Master when the NAS isn't running and restart MCM when it is.

You can do this by comparing the PING output in a batch file, bash script, PowerShell script, etc. and calling MediaCenterMaster.exe with /close to gracefully close all MCM processes. When the server is responding again, you can call MediaCenterMaster with /single to force MCM to only run a single instance.

_________________
Peter Souza IV
stable version 2.19.23119.1014 / August 19th, 2019
Media Center Master on Facebook!


 Profile  
 Post subject: Re: Check NAS before processing
PostPosted: August 16th, 2019, 3:11 pm 
Offline
Downloaded Clip

Joined: July 30th, 2019, 12:22 pm
Posts: 6
I tried doing this Pete to compare ping output in a script to try and help and my laptop ended up in a tree.
There was nothing graceful about it.
:lol:
Hopefully the OP had better luck.


 Profile  
 Post subject: Re: Check NAS before processing
PostPosted: August 16th, 2019, 5:47 pm 
Offline
Developer/Owner
User avatar

Joined: May 1st, 2009, 10:12 am
Posts: 11610
Location: Meridian, ID, USA
Just change 'hosttocheck' to whatever your NAS IP is.

Save it as 'waitfornetwork.bat' and CALL it from another batch file, etc. as needed.

Code:
@ECHO OFF

SET hosttocheck=192.168.0.33

:waitfornetwork

PING -n 1 -w 1000 %hosttocheck% >netcheck.txt

FINDSTR /C:"Packets: Sent = 1, Received = 0, Lost = 1" netcheck.txt >NUL 2>NUL
IF %ERRORLEVEL% == 0 (
   GOTO waitfornetwork
)

FINDSTR /C:"Request timed out." netcheck.txt >NUL 2>NUL
IF %ERRORLEVEL% == 0 (
   GOTO waitfornetwork
)

FINDSTR /C:"Destination host unreachable." netcheck.txt >NUL 2>NUL
IF %ERRORLEVEL% == 0 (
   GOTO waitfornetwork
)

DEL netcheck.txt
SET hosttocheck=

_________________
Peter Souza IV
stable version 2.19.23119.1014 / August 19th, 2019
Media Center Master on Facebook!


 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group



Copyright © 2009-2019, Media Center Master, Inc. All rights reserved.