The exit command was running unconditionally which broke the system
configuration. Fix that and simplify the wan interface check.
Run network.wan deletion quietly in case it doesn't exist.
Signed-off-by: Chester A. Unal <redacted>
include $(TOPDIR)/rules.mk
PKG_NAME:=bsbf-resources
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=AGPL-3.0-or-later
PKG_MAINTAINER:=Chester A. Unal <chester.a.unal@arinc9.com>
final_wan_interfaces="$wan_network_interface $(echo $lan_interfaces | tr ' ' '\n' | grep -v "^$lan_network_interface$")"
# Exit if there are no suitable wan interfaces.
-[ -z "$(echo "$final_wan_interfaces" | tr ' ' '\n')" ] && uci revert network ; exit 0
+[ -z "$(echo $final_wan_interfaces)" ] && { uci revert network ; exit 0; }
# Delete existing wan and wan6 networks.
-uci delete network.wan
+uci -q delete network.wan
uci -q delete network.wan6
uci -q del_list firewall.$fw_section.network='wan'
uci -q del_list firewall.$fw_section.network='wan6'