packages/utils/cache-domains/files/30-cache-domains
Gerard Ryan af8d806407 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>
2020-07-11 22:36:15 +10:00

14 lines
288 B
Bash

#!/bin/sh
. /lib/functions/network.sh
network_find_wan WAN_IFACE
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