scripts-reco

Des scripts pour faciliter le reconditionnement de portables - retour accueil

git clone git://bebou.netlib.re/scripts-reco

Log | Files | Refs | README |

commit 6978158d2fe177ec89b2f88ab0e64ec638257e28
parent 4be2a8ffff4f4f40fb5491877d184212c1f4590b
Auteurice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Mon, 17 Mar 2025 10:19:18 +0100

Gestion plusieurs bat et/ou batterie pas sur BAT0

Diffstat:
Mtests/rapport | 22+++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/tests/rapport b/tests/rapport @@ -17,12 +17,16 @@ sudo dmidecode -t memory | awk -F':' ' }' # Batterie -. "/sys/class/power_supply/BAT0/uevent" -health=$(echo "$POWER_SUPPLY_CHARGE_FULL / $POWER_SUPPLY_CHARGE_FULL_DESIGN * 100" | bc -l | cut -d'.' -f1) -<<. cat -Batterie : Capacité totale initiale ${POWER_SUPPLY_CHARGE_FULL_DESIGN%???} mAh -Batterie : Capacité totale courante ${POWER_SUPPLY_CHARGE_FULL%???} mah, ratio : $health -Batterie : Charge courante ${POWER_SUPPLY_CHARGE_NOW%???} mAh, $POWER_SUPPLY_CAPACITY% -Batterie : Status $POWER_SUPPLY_STATUS -Batterie : Manufacturer $POWER_SUPPLY_MANUFACTURER -. + +for batterie in $(find /sys/class/power_supply/ -type l -name 'BAT*');do + . "$batterie/uevent" + health=$(echo "$POWER_SUPPLY_CHARGE_FULL / $POWER_SUPPLY_CHARGE_FULL_DESIGN * 100" | bc -l | cut -d'.' -f1) + <<-. cat + Batterie : $(basename $batterie) + Batterie : Capacité totale initiale ${POWER_SUPPLY_CHARGE_FULL_DESIGN%???} mAh + Batterie : Capacité totale courante ${POWER_SUPPLY_CHARGE_FULL%???} mah, ratio : $health + Batterie : Charge courante ${POWER_SUPPLY_CHARGE_NOW%???} mAh, $POWER_SUPPLY_CAPACITY% + Batterie : Status $POWER_SUPPLY_STATUS + Batterie : Manufacturer $POWER_SUPPLY_MANUFACTURER + . +done