auanasgheps / snapraid-aio-script

The definitive all-in-one SnapRAID script on Linux. Diff, sync, scrub are things of the past. Manage SnapRAID and much, much more!
GNU General Public License v3.0
241 stars 36 forks source link

Add the option to execute the last custom hook before spinning down drives #120

Closed DonkeeeyKong closed 2 months ago

DonkeeeyKong commented 2 months ago

Description

If hd-idle is configured and the spin-down functionality of the script is activated, the drives are spun down in the end of the script and a possible "custom hook" command is executed after that. Sometimes this command may access the drives in question and it would be preferred to execute the command before spinning down the drives. This PR adds a variable EXECUTE_BEFORE_SPINDOWN to the AFTER_HOOK_CMD section of the settings. If this variable is set to 1 , the command will be executed right before spinning down the disks instead of after.

(Another option would be to just add a third custom hook, that's executed before the spin-down. This PR already solves my use case though and I don't know if anyone else would use/need such a feature.)

Type of change

Checklist:

auanasgheps commented 2 months ago

That's a cool idea! Thanks for your contribution!