# Sourced after fw3/fw4 reload. Restore EdNovas rules without restarting the
# core, mirroring OpenClash's firewall hotplug path. The agent also verifies
# ordering/counters every 30 seconds as a fallback.
# Same agent lookup as the iface hook: the mini edition runs the agent from
# tmpfs and deletes the flash copy, so a fixed path never reached it.
if /etc/init.d/ednovas running 2>/dev/null; then
	agent="$(uci -q get ednovas.main.agent_path)"
	[ "$(uci -q get ednovas.main.mini)" = "1" ] && agent=/tmp/ednovas/ednovas-agent
	[ -x "$agent" ] || agent=/usr/share/ednovas/ednovas-agent
	( sleep 1; "$agent" firewall >/dev/null 2>&1 ) &
fi
