passer
A tiny tool can automatically power off system when network interface is down (potential external power failure).
Why is it named "passer"?
Passer is a genus of sparrows, also known as the true sparrows.
This tool consistently check network interface, if something go wrong, "passer" will fly away~~~
Usage
Ultra simple:
./passer <interface> <pre-shutdown script>
passer will monitor /sys/class/net/<interface>/operstate
, and if selected interface is down, power off system!