Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#144950 - 21/02/2003 23:07 Shell command to report power status
TheAmigo
enthusiast

Registered: 14/09/2000
Posts: 363
I'm guessing that probably nobody will find these usefull, but here they are just in case.

Two simple progs: ac and dc. The ac program reads /proc/empeg_power and returns true if the empeg is on ac and false if it's on dc. The dc prog is the other way 'round.

Why? It's less CPU and RAM overhead than grep "Power)" /proc_empeg_power | grep -c AC.


Attachments
142889-acdc.zip (36 downloads)

_________________________
--The Amigo

Top
#144951 - 22/02/2003 06:40 Re: Shell command to report power status [Re: TheAmigo]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Ah. But if you use open/read/close instead of the buffered IO functions it should save you a little more RAM
Using return instead of exit probably should shave a little more off the binary as well.

Sorry, being picky

- Trevor

Top