diff options
-rwxr-xr-x | datasources/yves_laserjet_tonerstatus.sh | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/datasources/yves_laserjet_tonerstatus.sh b/datasources/yves_laserjet_tonerstatus.sh index 6b7628a..a57253a 100755 --- a/datasources/yves_laserjet_tonerstatus.sh +++ b/datasources/yves_laserjet_tonerstatus.sh @@ -1,14 +1,11 @@ #!/bin/sh +. "`dirname \"$0\"`"/datastore-functions.sh name=yves.laserjet.tonerstatus -type=int curl -s "http://10.1.0.10/hp/device/info_suppliesStatus.html" | sed -ne 's/.*>\([0-9]*\)%<.*/\1/p' | ( read value - curl -s -i -H "Accept: application/json" \ - -X PUT "http://localhost:8000/sensor/${name}" \ - -d "value=${value}&type=${type}" | - grep '"error": null' >/dev/null + put_value_sensor_now "$name" "$value" ) |