cache-domains: Improved ifup hotplug reliability

I've noticed that in deployment on some reboots it won't configure,
This seems to be due to running before the system/network is ready.

Signed-off-by: Gerard Ryan <G.M0N3Y.2503@gmail.com>
This commit is contained in:
Gerard Ryan
2020-07-11 12:18:54 +10:00
parent f7dea4561b
commit af8d806407
3 changed files with 25 additions and 16 deletions
+9 -3
View File
@@ -1,8 +1,14 @@
#!/bin/sh
source /lib/functions/network.sh
. /lib/functions/network.sh
network_find_wan WAN_IFACE
if [ "${ACTION}" == "ifup" ] && [ "${INTERFACE}" == "${WAN_IFACE}" ] && [ ! -d /var/cache-domains ]; then
/usr/bin/cache-domains configure
if [ "${ACTION}" = "ifup" ] && [ "${INTERFACE}" = "${WAN_IFACE}" ] && [ ! -d /var/cache-domains ]; then
for ATTEMPT in $(seq 1 3); do
if /usr/bin/cache-domains configure; then
break
else
sleep 30
fi
done
fi