diff --git a/chip-battery.sh b/chip-battery.sh index 4c9beb1..7c31d58 100644 --- a/chip-battery.sh +++ b/chip-battery.sh @@ -61,7 +61,7 @@ function getChargeCurrent() { # shuts the system down if too less voltage function verifyBatteryVoltage() { echo "$(isBatteryAvailable)" - if [ "$(isBatteryAvailable)" -eq "1" ] ; then + if [ "$?" -eq "1" ] ; then local voltage=$(getBatteryVoltage) local chargeCurrent=$(getChargeCurrent) echo "Voltage: $voltage"