1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 11:51:57 +00:00
srs/trunk/scripts/htbt.sh

8 lines
325 B
Bash
Raw Normal View History

2015-10-26 06:17:24 +00:00
#/bin/bash
for ((;;)); do
2015-10-26 06:54:41 +00: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 06:17:24 +00: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 06:53:54 +00:00
sleep 10
2015-10-26 06:17:24 +00:00
done