Skip to content

Instantly share code, notes, and snippets.

Last active October 16, 2018 08:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Cubietruck + Battery + Armbian - shutdown server if critical battery level reached. Just added it to /etc/cron.hourly


I create a script that will try to send Warning Email and and shutdown the system as soon as it goes below 10%.

I put it in cron hourly and script should automatically check and do loop if battery discharging and below e.g. 80%.

E-Mail is needed because last time I did not know that my power supply died and I did not know why sever stopped. This version is also producing logs that could be checked after cubietruck fails. That helps for trouble shooting, e.g. to find out that power supply could not produce enough current to charge battery.

Log output example:

Tue Oct 16 10:01:03 CEST 2018 - Ok. Battery Full - 100% left. AC is online with current 0.222 A. Battery health is Good.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment