#!/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 )