Improve client script
This commit is contained in:
parent
4d2e3174db
commit
c76697f846
1 changed files with 8 additions and 2 deletions
10
client.sh
10
client.sh
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue