contrib/meshwizard: Add initial support for ipv6 config (with auto-ipv6-ib and dhcpv6)
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / wizard.sh
index fd9d95e..33ef0b0 100755 (executable)
@@ -12,7 +12,7 @@
 . /etc/functions.sh
 
 echo "
-/* Meshwizard 0.0.4 */
+/* Meshwizard 0.0.7 */
 "
 
 # config
@@ -63,13 +63,32 @@ if [ "$wan_proto" == "static" ] && [ -n "$wan_ip4addr" ] && [ -n "$wan_netmask"
        $dir/helpers/setup_wan_static.sh
 fi
 
+if [ "$lan_proto" == "static" ] && [ -n "$lan_ip4addr" ] && [ -n "$lan_netmask" ]; then
+       $dir/helpers/setup_lan_static.sh
+fi
+
+if [ "$profile_ipv6" == 1 ]; then
+       $dir/helpers/setup_lan_ipv6.sh
+       # Setup auto-ipv6
+       if [ "$profile_ipv6_config" = "auto-ipv6-dhcpv6" ]; then
+               $dir/helpers/setup_auto-ipv6.sh
+       fi
+fi
+
+# Setup policyrouting if internet sharing is disabled and wan is not used for olsrd
+# Always disable it first to make sure its disabled when the user decied to share his internet
+uci set freifunk-policyrouting.pr.enable=0
+if [ ! "$general_sharenet" == 1 ] && [ ! "$(uci -q get meshwizard.netconfig.wan_proto)" == "olsr" ]; then
+       $dir/helpers/setup_policyrouting.sh
+fi
+
 # Configure found networks
 for net in $networks; do
        # radioX devices need to be renamed
        netrenamed="${net/radio/wireless}"
        export netrenamed
        $dir/helpers/setup_network.sh $net
-       if [ ! "$net" == "wan" ]; then
+       if [ ! "$net" == "wan" ] && [ ! "$net" == "lan" ]; then
                $dir/helpers/setup_wifi.sh $net
        fi
        $dir/helpers/setup_olsrd_interface.sh $net