#!/bin/sh

# Script to migrate gateway-info options to gateway uci
if [ ! -f "/etc/config/cwmp" ] && [ ! -f "/etc/config/gateway" ]; then
	exit 0
fi

val="$(uci -q get cwmp.cpe.disable_gatewayinfo)"

if [ -n "$val" ] && [ "$val" -eq 1 ]; then
	uci -q set gateway.global.enable=0
fi

uci -q set cwmp.cpe.disable_gatewayinfo=""
