#!/bin/sh

LANDING_PAGE="/cgi-bin/luci/admin/istorerouter"

if uci -q show istorenas.@login[0] >/dev/null; then
	CURRENT_LANDING_PAGE="$(uci -q get istorenas.@login[0].landing_page)"
	if [ "$CURRENT_LANDING_PAGE" = "$LANDING_PAGE" ]; then
		uci -q delete istorenas.@login[0].landing_page || true
		uci -q commit istorenas || true
	fi
fi

rm -f /tmp/luci-indexcache /tmp/luci-indexcache.*
exit 0
