#!/bin/sh
[ -n "$IPKG_INSTROOT" ] || {
	# During a managed reinstall (in-app update / .run) the marker is set:
	# don't stop the service out from under the updater; it restarts itself.
	if [ ! -f /tmp/.ednovas-run-install ]; then
		/etc/init.d/ednovas stop 2>/dev/null
		/etc/init.d/ednovas disable 2>/dev/null
	fi
	# Unregister the fw3 include; the fw4 drop-in file is removed with the
	# package and its inert rules disappear on the next firewall reload.
	uci -q delete firewall.ednovas 2>/dev/null && uci commit firewall 2>/dev/null
}
exit 0
