hello.sh
#!/bin/ash
/root/hello.sh > feed_update_payload.json
curl -k --request PUT --data-binary @feed_update_payload.json --header "X-ApiKey: APIKEY" --verbose https://api.xively.com/v2/feeds/1476682391
ping 8.8.8.8 -w 4 -q | grep round | awk -F "/" '{ print $5 }' | cut -d" " -f 1
#!/bin/ash
used=`top -n1 | grep -v grep | grep Mem | awk '{ print $2 }' | cut -d'K' -f 1`
free=`top -n1 | grep -v grep | grep Mem | awk '{ print $4 }' | cut -d'K' -f 1`
cat > /root/feed_update_payload.json <<EOF
{
"version":"1.0.0",
"datastreams":[
{"id":"used",
"current_value":"$used"},
{"id":"free",
"current_value":"$free"}
]
}
EOF
curl -k "https://api.thingspeak.com/update?key=RU9AV4EG9J7MVW5N&field1=$free&field2=$used"
curl -k "https://data.sparkfun.com/input/xR1ppMypZ3fWDoYyzpgQ?private_key=ZadrrAGrqEU7wXol96zp&free=$free&used=$used"
curl -k --request PUT --data-binary @/root/feed_update_payload.json --header "X-ApiKey: b1MbpP25QtZSgol8hr3CihDn6vxNVEulYeOhIZ27UOKzFapv" https://api.xively.com/v2/feeds/1476682391