#!/bin/sh
if [ -z "${IPKG_INSTROOT}" ]; then
	rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
	# reload (not restart) rpcd so the LuCI login session survives the upgrade —
	# rpcd restart drops every ubus session and forces a re-login (issue #12).
	# reload still picks up the new ucode backend + ACL. uhttpd needs nothing:
	# updated static assets are served on the next request.
	/etc/init.d/rpcd reload >/dev/null 2>&1 || true
fi
exit 0
