X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=contrib%2Fpackage%2Fmeshwizard%2Ffiles%2Fusr%2Fbin%2Fmeshwizard%2Fwizard.sh;h=77c6cd95e90e4f977aed4546a58b2e23acc61c45;hp=4bdc2c88f403ad3dba0772a32ca9201c24c706cf;hb=86503afdd9c35baa9c63ae1c838f228372269e93;hpb=163b224b25d003cc6ca555b305bdbc89b2dd61b6 diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh index 4bdc2c88f..77c6cd95e 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh @@ -12,12 +12,13 @@ . /lib/functions.sh echo " -/* Meshwizard 0.0.7 */ +/* Meshwizard 0.2.0 */ " # 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 @@ -58,19 +59,30 @@ $dir/helpers/setup_dnsmasq.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" == "dhcp" ]; then + $dir/helpers/setup_wan_dhcp.sh +fi + +if [ -n "$wan_down" -a -n "$wan_up" ]; then + $dir/helpers/setup_qos.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 - 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 @@ -87,10 +99,21 @@ 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" ] && [ ! "$net" == "lan" ]; then $dir/helpers/setup_wifi.sh $net + # check if this net supports vap + /sbin/wifi # wifi needs to be up for the check + export supports_vap="0" + type="$(uci -q get wireless.$net.type)" + [ -n "$type" ] && $dir/helpers/supports_vap.sh $net $type && export supports_vap=1 + if [ "$supports_vap" = 1 ]; then + $dir/helpers/setup_wifi_vap.sh $net + fi fi + + $dir/helpers/setup_network.sh $net + $dir/helpers/setup_olsrd_interface.sh $net net_dhcp=$(uci -q get meshwizard.netconfig.${net}_dhcp) @@ -100,8 +123,19 @@ for net in $networks; do $dir/helpers/setup_splash.sh $net $dir/helpers/setup_firewall_interface.sh $net + + if [ -n "$(echo "$ipv6_config" |grep auto-ipv6)" ]; then + $dir/helpers/setup_auto-ipv6-interface.sh $net + fi done +##### postinstall script + +[ -f /etc/rc.local.meshkitpostinstall ] && /etc/rc.local.meshkitpostinstall + + ##### Reboot the router (because simply restarting services gave errors) +echo "+ The wizard has finished and the router will reboot now." + reboot