Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/system/bin/bash
- #
- # Android Shell Script to calibrate Transformer main battery
- # Thanks to seo and LeeDroid for the script
- # Amended by Roach2010 for Prime!
- SLEEP=120
- while : ; do
- LEVEL=$(cat /sys/class/power_supply/battery/capacity)
- STATUS=$(cat /sys/class/power_supply/battery/status)
- VOLTAGE=$(cat /sys/class/power_supply/battery/voltage_now)
- if [ "$LEVEL" == "100" ] && [ "$STATUS" == "Full" ] ; then
- log -p i -t battery-calibration "Calibrating battery... [LEVEL: $LEVEL] [STATUS: $STATUS] [VOLTAGE: $VOLTAGE]"
- busybox rm -f /data/system/batterystats.bin
- touch /data/.battery-calibrated
- sync
- log -p i -t battery-calibration "Battery calibration complete."
- exit 0
- fi
- log -p i -t battery-calibration "Calibration in progress... [LEVEL: $LEVEL] [STATUS: $STATUS] [VOLTAGE: $VOLTAGE] sleeping for $SLEEP seconds."
- sleep $SLEEP
- done
Add Comment
Please, Sign In to add comment