Hash : d2210b9b Author : Thomas de Grivel Date : 2022-04-10T09:02:56
Download
1 2 3 4 5
#!/bin/sh MAX="$(sysctl -n hw.sensors.aplsmc0.amphour1 | cut -d ' ' -f 1)" POWER="$(sysctl -n hw.sensors.aplsmc0.amphour0 | cut -d ' ' -f 1)" PERCENT=$({ echo scale=1; echo "$POWER*100/$MAX"; } | bc) echo ${PERCENT}%