#!/bin/sh #max_current=2848 max_current=2048 #read -r cap < /sys/class/power_supply/sbs-6-000b/capacity while true; do cap=$(cat /sys/class/power_supply/sbs-6-000b/capacity) echo $cap if [ $cap -gt 87 ]; then ectool chargestate param 1 0 fi if [ $cap -lt 85 ]; then ectool chargestate param 1 $max_current fi sleep 10 done