diff --git a/chip-battery.sh b/chip-battery.sh index d726afd..9dfb9cd 100755 --- a/chip-battery.sh +++ b/chip-battery.sh @@ -39,7 +39,11 @@ function shutdownCommand() { # @return ... 0,1 as return value function isBatteryAvailable() { local flags=$(i2cget -f -y 0 0x34 0x01) - return $(((( $flags&0x20 ) >>5 ) == $TRUE )) + if (((( $flags&0x20 ) >>5 ) == $TRUE )); then + echo "1" + else + echo "0" + fi } # @return ... voltage as string