Guest User

Untitled

a guest
Feb 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #!/system/bin/bash
  2. #
  3. # Android Shell Script to calibrate Transformer main battery
  4. # Thanks to seo and LeeDroid for the script
  5. # Amended by Roach2010 for Prime!
  6.  
  7. SLEEP=120
  8.  
  9. while : ; do
  10. LEVEL=$(cat /sys/class/power_supply/battery/capacity)
  11. STATUS=$(cat /sys/class/power_supply/battery/status)
  12. VOLTAGE=$(cat /sys/class/power_supply/battery/voltage_now)
  13. if [ "$LEVEL" == "100" ] && [ "$STATUS" == "Full" ] ; then
  14. log -p i -t battery-calibration "Calibrating battery... [LEVEL: $LEVEL] [STATUS: $STATUS] [VOLTAGE: $VOLTAGE]"
  15. busybox rm -f /data/system/batterystats.bin
  16. touch /data/.battery-calibrated
  17. sync
  18. log -p i -t battery-calibration "Battery calibration complete."
  19. exit 0
  20. fi
  21. log -p i -t battery-calibration "Calibration in progress... [LEVEL: $LEVEL] [STATUS: $STATUS] [VOLTAGE: $VOLTAGE] sleeping for $SLEEP seconds."
  22. sleep $SLEEP
  23. done
Add Comment
Please, Sign In to add comment