Improve client script

This commit is contained in:
Kumi 2018-11-28 10:04:11 +01:00
parent 4d2e3174db
commit c76697f846

View file

@ -4,9 +4,15 @@ sleep 10
wget -O- https://admin360.kumi.host/hosts --post-data "secret=$SECRET"
ipaddr(){
if="${1:-br-VPN360}"
result=$(/sbin/ip -o -4 addr show dev "${if}" | sed 's/^.*inet // ; s/\/...*$//')
printf %s "${result}"
tty -s && printf "\n"
}
while [ True ]; do
IP=$(ifconfig br0 | awk '/inet /{print substr($2,1)}');
sleep 60;
wget -O- https://admin360.kumi.host/heartbeat --post-data "secret=$SECRET&ip=$IP";
wget -O- https://admin360.kumi.host/heartbeat --post-data "secret=$SECRET&ip=$(ipaddr)";
done