#!/bin/sh #%# family=auto #%# capabilities=autoconf if [ "$1" = "autoconf" ]; then if [ -e /sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply ]; then echo yes else echo no fi exit 0 fi if [ "$1" = "config" ]; then echo 'graph_title BananaPi PM Current' echo 'graph_vlabel Ampere' echo 'graph_category sensors' echo 'current.label System Current' echo 'current.cdef current,1000000,/' exit 0 fi echo current.value "$(cat /sys/class/power_supply/ac/current_now)" exit 0