2015-02-21 12:18:27 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-03-21 16:19:08 -04:00
|
|
|
start () {
|
2015-03-12 15:59:09 -04:00
|
|
|
if [ -z $STATHAT_API_KEY ]; then
|
2015-03-14 16:44:06 -04:00
|
|
|
echo "Error: stathat requires \$STATHAT_API_KEY to be specified"
|
2015-03-12 15:59:09 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2015-02-21 12:18:27 -05:00
|
|
|
report () {
|
2015-03-14 16:44:06 -04:00
|
|
|
local metric=$1
|
|
|
|
local value=$2
|
|
|
|
|
|
|
|
curl -s -d "ezkey=$STATHAT_API_KEY&stat=$metric&value=$value" \
|
2015-03-12 15:59:09 -04:00
|
|
|
http://api.stathat.com/ez > /dev/null
|
2015-02-22 14:45:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
docs () {
|
|
|
|
echo "Send data to StatHat (https://www.stathat.com)."
|
2015-03-21 16:19:08 -04:00
|
|
|
echo "STATHAT_API_KEY=$STATHAT_API_KEY"
|
2015-02-21 12:18:27 -05:00
|
|
|
}
|