File: //etc/init/syno-network-check.conf
description "Check if network is ready"
author "System Integration Team"
start on syno.net.device_up IFACE!=lo
stop on runlevel [06]
console log
pre-start script
## log time for debug purpose
/bin/date || true
echo "network_iface_ready="`awk '{print $1}' /proc/uptime` >> /run/synoservice/bootup_time_detail || true
/usr/syno/bin/synofirewall --reload || true
/usr/syno/bin/syno_iptables_common start || true
## make sure getaddrinfo function is work before emit network.ready event
for i in `seq 1 1 30`; do
if /usr/syno/sbin/synobootupcheck --check-network; then
break;
fi
/bin/sleep 1 || true
done
## emit syno.network.ready
/bin/echo `/bin/date` "[${IFACE}] emits syno.network.ready" || true
/sbin/initctl emit --no-wait syno.network.ready || true
echo "network_ready="`awk '{print $1}' /proc/uptime` >> /run/synoservice/bootup_time_detail || true
end script