Have we actually developed the master event script (/usr/local/emhttp/emhttp_event) yet? I'm ready to update my plugins to use it, but since there is no active code in the unRAID stock sript, I don't want to overwrite what it there, since I'm sure a future version will have it.
To start with, we could simply use:
find ./plugins -type f -perm /+x -maxdepth 2 -name event.sh -exec {}
\;
I've been working on one that implimented a lot of the ideas presented.
From my recollection, and based on
this thread, and specifically,
this post ,Tom was looking for the script names to be
event_<eventname>.sh
So, we would need to modify your simple line to be
find ./plugins -type f -perm/+x -maxdepth 2 -name event_${1}.sh -exec {} \;
Now, we could certainly experiment with both standards, and have two lines as follows:
find ./plugins -type f -perm /+x -maxdepth 2 -name event_${1}.sh -exec {} \;
find ./plugins -type f -perm /+x -maxdepth 2 -name event.sh -exec {} $1 \;
Note: I added $1 to the end of the exec on the line you suggested, since if only one script is involved, it would need to know the event being passed.
These would not be fool-proof, but it will get us running.
For a start,we can put the two lines suggested above...and worry about synchronization when we get to a package that requires it.
We also have
WeeboTech's suggestion for a central directory for those events that must be synchronized and his proposed
find /usr/local/emhttp/event.d/$1.d -type f -follow -perm /u+x -printf "%p $1\n" | sort | xargs -L1 /bin/sh -cI think that depending on the naming used, the third approach suggesteg by WeeboTech might have an event called twice if it is linked to emhttp/event.d/. We'll need to think that through based on Tom's post.
I've been working on a more fool-proof version, but wanted to wait to see what 5.2 offered first. Never found the time to get it changed to use the scheme Tom implemented in 5.2. I'll try to get to it later today.
Joe L.