I have the classic minidlna issue that, when a usb external drive is plugged in, minidlna sees no files although it is enabled and running, because minidlana starts before the drive has finished mounting.
the result is that to watch something I often have to SSH in to the router and restart the minidlna service, whereupon the files show up correctly.
could anyone help me - a complete novice at this - draft a script to fix
So I am thinking of
disabling automatic mount for the two USB drives
And instead running a script in /etc/rc.local (I assume that writing it in Luci > System > scheduled Tasks does the same) to a) mount the two USB drives first, b) enforce a delay, and then c) start Minidlna.
I hope that the act of plugging the drives into the router triggers the mount and the mounting triggers the minidlna start.
but could anyone advise what such a script should look like please?
Edit the init script for minidlna: nano /etc/init.d/minidlna
Scroll down to service_triggers()
Add this line right after service_triggers() {: procd_add_reload_mount_trigger /mnt/example (replacing /mnt/example with the mount point of your external storage device)
Run these commands to (hopefully) make procd realize that the service triggers changed: service minidlna stop; service minidlna disable; service minidlna enable; service minidlna start
(I'm not sure that this will do it, a restart may be needed?)
Now re/connect your external drive and check whether minidlna now finds the media on it.
I suggest you to start with just one drive. This is just a test to see if this works or not. If this does work, a permanent solution would be to make a custom init script and there both of your drives can be set up.