contrib/meshwizard: fix LAN with OLSR and DHCP
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / wizard.sh
index b666313e460e2a538eed8d8a10f3adfcf07c8953..372148997c1d511d1e0152db2c16836556a4b740 100755 (executable)
@@ -10,7 +10,7 @@
 # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 
 echo "
-/* Meshwizard 0.3.0 */
+/* Meshwizard 0.3.1 */
 "
 
 # config
@@ -34,6 +34,8 @@ cleanup=$(uci -q get meshwizard.general.cleanup)
 # Rename wifi interfaces
 $dir/helpers/rename-wifi.sh
 
+export lan_is_olsr="$(uci -q get meshwizard.netconfig.lan_config)"
+
 # Get community
 community="$(uci -q get meshwizard.community.name || uci -q get freifunk.community.name)"
 [ -z "$community" ] && echo "Error: Community is not set in /etc/config/freifunk, aborting now." && exit 1
@@ -114,6 +116,13 @@ for net in $networks; do
        $dir/helpers/setup_olsrd_interface.sh $net
 
        net_dhcp=$(uci -q get meshwizard.netconfig.${net}_dhcp)
+       export ${net}_dhcp=$net_dhcp
+
+        if [ "$net" = "lan" ] && [ "$lan_is_olsr" = "1" ]; then
+                uci -q set dhcp.lan.ignore="1"
+                uci_commitverbose "Disable DHCP on LAN because it is an olsr interface." dhcp
+        fi
+
        if [ "$net_dhcp" == 1 ]; then
                $dir/helpers/setup_dhcp.sh $net
        fi