hd-idle
hd-idle copied to clipboard
Add possibility to execute scripts after spinup or spindown
This is a feature I personally required. What I use it for:
- send notification to Home Assistant on spin-up and on spin-down so I can track HDD state in Home Assistant
- execute
dfcommand after spin-up and send output to Home Assistant - allows me to track free space left on disk (alternatives like periodically executing thedfcommand via ssh would oftentimes spin-up the drive unnecessarily).
I considered building a service to observe the system journal for hd-idle's logs, but this solution proved much nicer.
Important note: I'm not a security expert, but I imagine there's a potential security risk, as hd-idle runs as root and will therefore execute the given scripts as root. So I can understand if there are concerns here. If you think this feature is nice to have, maybe someone with more security expertise can review and potentially advise on how to secure this. Otherwise, feel free to close this PR, all good. Just wanted to offer to contribute back the work I put in.
Thanks for this great tool!