	#!/bin/sh
	[ -n "${IPKG_INSTROOT}" ] || {
		[ -x /usr/sbin/gogogo-cred ] && /usr/sbin/gogogo-cred repair >/dev/null 2>&1 || true
		if [ -z "$(uci -q get gogogo.@default[0].dnsleak)" ]; then
			_ipmode=$(uci -q get gogogo.@default[0].ipmode)
			if [ "$_ipmode" = "1" ]; then
				uci -q set gogogo.@default[0].dnsleak=1
			else
				uci -q set gogogo.@default[0].dnsleak=0
			fi
		fi
		uci -q delete gogogo.@default[0].ipmode
		uci -q set dhcp.@dnsmasq[0].rebind_protection=0
		uci commit gogogo >/dev/null 2>&1 || true
		uci commit dhcp >/dev/null 2>&1 || true
		[ -x /usr/sbin/gogogo ] && /usr/sbin/gogogo apply_timezone >/dev/null 2>&1 || true
		[ -x /usr/sbin/gogogo-cred ] && /usr/sbin/gogogo-cred sync >/dev/null 2>&1 || true
		/etc/init.d/quagga stop >/dev/null 2>&1 || true
		/etc/init.d/quagga disable >/dev/null 2>&1 || true
		/etc/init.d/gogogo enable >/dev/null 2>&1 || true
		rm -rf /tmp/luci-indexcache /tmp/luci-modulecache >/dev/null 2>&1 || true
	}
	exit 0
