. /lib/functions.sh

migrate_release() {
	local config="$1"
	local proto
	local release

	config_get proto "$config" proto
	config_get release "$config" release

	[ "$proto" = "dhcp" ] && [ -n "$release" ] && {
		norelease="$((!$release))"
		uci_set network "$config" norelease "$norelease"
		uci_remove network "$config" release
	}

}

config_load network
config_foreach migrate_release interface
uci commit network

exit 0
