Also, if you're using anything with a static IP, monitoring the DHCP obviously won't work.
If you got any of those, I'd recommend doing a static DHCP reservation, where the host is still using DHCP, but always gets the same IP.
I'm not sure how these are handled in regards to the commits hook though.
Maybe monitoring the ARP table can be useful to you depending on your use case, but then that's back to a "polling" scenario instead of being event based.
Actually you could have multiple triggers:
- Event based hook from the DHCP
- Polling the ARP table or even pinging a specific static host that isn't DHCP compatible
- microphone based detection: When someone in your household yells that it doesn't work again, bring it up.
Anyway, calling it from the hook or cronjob kinda becomes an "or" condition for bringing it up: Any one host brings it up, regardless of how you detect them.
But then you likely still need an "and" condition when bringing it down: All conditions/hosts must be down for a period of time to bring it down.
Also consider future troubleshooting. Maybe having some sort of toggle to force it up (and disable the wgdown scripts) if only for confirming an hypothesis during a future problem.
Have fun