contrib/meshwizard: allowssh and allowweb can be set for wan dhcp proto too now
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / wizard.sh
index 33ef0b0..eae4de8 100755 (executable)
@@ -9,15 +9,16 @@
 # You may not use this file except in compliance with the License.
 # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 
-. /etc/functions.sh
+. /lib/functions.sh
 
 echo "
-/* Meshwizard 0.0.7 */
+/* Meshwizard 0.0.8 */
 "
 
 # config
 export dir="/usr/bin/meshwizard"
 . $dir/functions.sh
+[ -f /proc/net/ipv6_route ] && export has_ipv6=1
 
 # Check which packages we have installed
 export has_luci=FALSE
@@ -63,11 +64,15 @@ if [ "$wan_proto" == "static" ] && [ -n "$wan_ip4addr" ] && [ -n "$wan_netmask"
        $dir/helpers/setup_wan_static.sh
 fi
 
+if [ "$wan_proto" == "dhcp" ]; then
+       $dir/helpers/setup_wan_dhcp.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
+if [ "$profile_ipv6" == 1 ] && [ "$has_ipv6" = 1 ]; then
        $dir/helpers/setup_lan_ipv6.sh
        # Setup auto-ipv6
        if [ "$profile_ipv6_config" = "auto-ipv6-dhcpv6" ]; then
@@ -100,8 +105,14 @@ for net in $networks; do
 
        $dir/helpers/setup_splash.sh $net
        $dir/helpers/setup_firewall_interface.sh $net
+
+       if [ "$profile_ipv6" == 1 ] && [ "$has_ipv6" = 1 ]; then
+               $dir/helpers/setup_radvd_interface.sh $net
+       fi
 done
 
 ##### Reboot the router (because simply restarting services gave errors)
 
+echo "+ The wizard has finished and the router will reboot now."
+
 reboot