Files
srs/trunk/scripts/htbt.sh

8 lines
325 B
Bash
Raw Permalink Normal View History

2015-10-26 14:17:24 +08:00
#/bin/bash
for ((;;)); do
2015-10-26 14:54:41 +08:00
ip=`ifconfig 2>&1|grep "inet addr"|grep -v "127"|awk '{print $2}'|awk -F ':' '{print $2}'`
echo "heatbeat at `date`, ip is ${ip}"
2015-10-26 14:17:24 +08:00
curl 'http://ossrs.net:8085/api/v1/servers' -H 'Content-Type: text/html' --data-binary "{\"ip\":\"${ip}\",\"device_id\":\"respberry-pi2\"}" && echo ""
2015-10-26 14:53:54 +08:00
sleep 10
2015-10-26 14:17:24 +08:00
done