mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 19:31:53 +00:00
7 lines
325 B
Bash
Executable file
7 lines
325 B
Bash
Executable file
#/bin/bash
|
|
for ((;;)); do
|
|
ip=`ifconfig 2>&1|grep "inet addr"|grep -v "127"|awk '{print $2}'|awk -F ':' '{print $2}'`
|
|
echo "heatbeat at `date`, ip is ${ip}"
|
|
curl 'http://ossrs.net:8085/api/v1/servers' -H 'Content-Type: text/html' --data-binary "{\"ip\":\"${ip}\",\"device_id\":\"respberry-pi2\"}" && echo ""
|
|
sleep 10
|
|
done
|