Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rebby

macrumors 6502
Original poster
Nov 19, 2008
312
1
MN
Does anybody know of a way to check the battery status from the console on a Macbook? I'd like to create a cron job that will only execute if running on A/C power.

I've done a few searches and have come up empty thus far. Thanks!
 
Looks like I jumped the gun on this one. It's buried with-in ioreg ->

Code:
ioreg -l | awk '/ExternalConnected/ {print $5}'

Will output "Yes" if external power is connected, "No" otherwise.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.