One way to do that is to use a USB Hard disk enclosures that requires AC power. Connect this enclosure to mains and add a cheap / spare SATA desktop HDD.
With a cron job, a shell script can check presence of this HDD (E.g. lsusb | grep "device-id-here") every minute. If this HDD is not present, shutdown can be initiated by the same script.
Similarly, you can attach a cheap / spare router (would cost 400 - 900 Rs) to AC mains and check reach-ability of this router to determine presence of power in mains.
On Fri, Feb 15, 2013 at 7:57 PM, Binand Sethumadhavan binand@gmail.comwrote:
(idea is to detect power failures, while powered by a "dumb" UPS unit - one that cannot communicate with the a computer. Any other solutions/suggestions?).
Binand