Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

executable file 27 lines (21 sloc) 0.615 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#!/bin/bash
. /etc/webc/functions.sh
. /etc/webc/webc.conf
server="http://ping.webconverger.org/"
sleeping=5

# $device at this point does not tell us if we are running the "install version", since the rw remount happens later

webcping () {
logger "Pinging $server"
wget -qO- --timeout=5 --post-data="M=$(
mac_address | md5sum | awk '{print $1}'
)&V=${webc_version}&D=${device}&K=${kernel}" "$server"
}

lockdir=/var/run/webcping
test -f "$lockdir" && exit 0
touch "$lockdir"

cmdline_has noping ||
while ! webcping
do

logger "Failed to ping $server, sleeping $sleeping seconds"
sleep "$sleeping"

done &
Something went wrong with that request. Please try again.