diff options
author | Ebus-at-dockstar <ebus@dockstar> | 2013-03-25 11:42:52 +0100 |
---|---|---|
committer | Ebus-at-dockstar <ebus@dockstar> | 2013-03-25 11:43:05 +0100 |
commit | 6f20cda5c3071e03d2a56dc8236a530582cad2b7 (patch) | |
tree | 0aec854bc129ccf44bf35b70aac86b50bd24fa85 /datasources/yves_laserjet_tonerstatus.sh | |
parent | 862282ce99760832d3e9e5b4b1171b861105e004 (diff) | |
download | ebus-alt-6f20cda5c3071e03d2a56dc8236a530582cad2b7.tar.gz ebus-alt-6f20cda5c3071e03d2a56dc8236a530582cad2b7.zip |
neue datenquellen
Diffstat (limited to 'datasources/yves_laserjet_tonerstatus.sh')
-rwxr-xr-x | datasources/yves_laserjet_tonerstatus.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/datasources/yves_laserjet_tonerstatus.sh b/datasources/yves_laserjet_tonerstatus.sh new file mode 100755 index 0000000..6b7628a --- /dev/null +++ b/datasources/yves_laserjet_tonerstatus.sh @@ -0,0 +1,14 @@ +#!/bin/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 + ) |