For UPS devices without serial/network signaling, this script-based method can automatically detect external power outage and shut down Linux safely.
Principle
Use a network target that loses connectivity when mains power fails. If ping fails continuously for a configured period, trigger shutdown.
Cron Schedule
Run as root (requires shutdown permission):
|
|
Script Example
/root/detect_ups.sh
|
|