Fix migration of wen settings when they've never been modified. (#526)

When wan settings had never been modified, they would be migrated
incorrectly.
This commit is contained in:
Tim Wilkinson 2022-10-16 18:31:31 -07:00 committed by GitHub
parent b5acf18bcf
commit d581b9952a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -16,6 +16,10 @@ if [ "${noroute}" != "" ]; then
/sbin/uci -c /etc/config.mesh set aredn.@wan[0].lan_dhcp_defaultroute=0
/sbin/uci -c /etc/config.mesh commit aredn
sed -i /^lan_dhcp_noroute\ =/d /etc/config.mesh/_setup
elif [ "$(/sbin/uci -c /etc/config.mesh -q get aredn.@wan[0].lan_dhcp_route)" = "" ]; then
/sbin/uci -c /etc/config.mesh set aredn.@wan[0].lan_dhcp_route=1
/sbin/uci -c /etc/config.mesh set aredn.@wan[0].lan_dhcp_defaultroute=0
/sbin/uci -c /etc/config.mesh commit aredn
fi
if [ "${olsrd_gw}" != "" ]; then