I am not aware if there is already such a facility.

My UPS has a USB interface and has a special driver which works only
on Windows :(.

This is what I did:
I connected my desktop to UPS.
I connected my modem to raw power.
Enabled NWAM on my desktop

Ran a while loop, as root, which pings yahoo.com every 2 minutes.
If three attempts fail, then I poweroff the system.

In case the power comes back within that time, then it'll continue to
work as NWAM would re-enable the interface.

Because of buggy NWAM this would not work every time.  So, in the
while loop, I would disable and enable nwam service.  That worked.

One issue with this is that the network immediately fails if there is
a power failure.  Since my priorities have changed, I've now connected
my modem to the UPS as well..

~Kini

On Wed, Jun 18, 2008 at 8:59 PM, sham pavman <shampavman.cg at gmail.com> wrote:
> Hi all,
>
> I am planning on writing a poweroff script that automatically checks to see
> if the system is running on UPS and if so then attempts a shutdown
> immediately.
> I got this idea,thanks to very reliable power supply in our area. ;-)
> I have an UPS that gives me a backup of 15mins ,and more often than not,my
> computer runs all through the night.
>
> Now I am not sure if there is already such a script or service that is
> running and its only a matter of enabling it to reap the benefits..
> But if not they i want to give it a try..
>
> On this regard ,i have a few queries..
> I dont know which script actually has all the power info in it.
> So i wanted to know where i need to look  for these informations  and
> perhaps extract from it to see if its running on UPS then do the rest..
>
> I would like to give this a try myself ,so can you please let me know how i
> need to proceed?
>
> Regards
> Shampavman
> blogs.sun.com/sham
>
>
>
> _______________________________________________
> ug-bosug mailing list
> List-Unsubscribe: mailto:ug-bosug-unsubscribe at opensolaris.org
> List-Owner: mailto:ug-bosug-owner at opensolaris.org
> List-Archives: http://www.opensolaris.org/jive/forum.jspa?forumID=54
>



-- 
Jayakara Kini

Reply via email to