Add widget config from community profile to meshwizard
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / wizard.sh
index 8c9088f073b90caa6468a091203db5487e257442..1aba71e0707a5b4d1f84e5f3cddbb972e1e4d981 100755 (executable)
 . /lib/functions.sh
 
 echo "
 . /lib/functions.sh
 
 echo "
-/* Meshwizard 0.0.7 */
+/* Meshwizard 0.0.8 */
 "
 
 # config
 export dir="/usr/bin/meshwizard"
 . $dir/functions.sh
 "
 
 # 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
 
 # Check which packages we have installed
 export has_luci=FALSE
@@ -58,19 +59,26 @@ $dir/helpers/setup_dnsmasq.sh
 $dir/helpers/setup_system.sh
 $dir/helpers/setup_olsrd.sh
 $dir/helpers/setup_firewall.sh
 $dir/helpers/setup_system.sh
 $dir/helpers/setup_olsrd.sh
 $dir/helpers/setup_firewall.sh
+$dir/helpers/setup_ssh.sh
+$dir/helpers/setup_uhttpd.sh
+$dir/helpers/setup_widgets.sh
 
 if [ "$wan_proto" == "static" ] && [ -n "$wan_ip4addr" ] && [ -n "$wan_netmask" ]; then
        $dir/helpers/setup_wan_static.sh
 fi
 
 
 if [ "$wan_proto" == "static" ] && [ -n "$wan_ip4addr" ] && [ -n "$wan_netmask" ]; then
        $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 [ "$lan_proto" == "static" ] && [ -n "$lan_ip4addr" ] && [ -n "$lan_netmask" ]; then
        $dir/helpers/setup_lan_static.sh
 fi
 
-if [ "$profile_ipv6" == 1 ]; then
+if [ "$ipv6_enabled" == 1 ] && [ "$has_ipv6" = 1 ]; then
        $dir/helpers/setup_lan_ipv6.sh
        # Setup auto-ipv6
        $dir/helpers/setup_lan_ipv6.sh
        # Setup auto-ipv6
-       if [ "$profile_ipv6_config" = "auto-ipv6-dhcpv6" ]; then
+       if [ -n "$(echo "$ipv6_config" |grep auto-ipv6)" ]; then
                $dir/helpers/setup_auto-ipv6.sh
        fi
 fi
                $dir/helpers/setup_auto-ipv6.sh
        fi
 fi
@@ -101,8 +109,8 @@ for net in $networks; do
        $dir/helpers/setup_splash.sh $net
        $dir/helpers/setup_firewall_interface.sh $net
 
        $dir/helpers/setup_splash.sh $net
        $dir/helpers/setup_firewall_interface.sh $net
 
-       if [ "$profile_ipv6" == 1 ]; then
-               $dir/helpers/setup_radvd_interface.sh $net
+       if [ -n "$(echo "$ipv6_config" |grep auto-ipv6)" ]; then
+               $dir/helpers/setup_auto-ipv6-interface.sh $net
        fi
 done
 
        fi
 done
 
@@ -110,4 +118,4 @@ done
 
 echo "+ The wizard has finished and the router will reboot now."
 
 
 echo "+ The wizard has finished and the router will reboot now."
 
-reboot
+#reboot