include $(TOPDIR)/rules.mk
PKG_NAME:=meshwizard
-PKG_RELEASE:=0.0.6
+PKG_RELEASE:=0.0.7
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
--- /dev/null
+#!/bin/sh
+local PREFIX="$(echo $profile_ipv6_prefix| cut -d "/" -f 1| sed 's/::/:/')"
+local MAC="$(ifconfig $1 |grep HWaddr | awk '{ print $5 '})"
+local IPV6_UNIQ="$(echo $MAC | awk -F: '{ print $1$2":"$3$4":"$5$6 }')"
+
+echo "${PREFIX}${IPV6_UNIQ}:1"
+
--- /dev/null
+#!/bin/sh
+
+. $dir/functions.sh
+
+# Setup auto-ipv6
+
+if [ "$profile_ipv6_config" = "auto-ipv6-dhcpv6" ]; then
+ uci set autoipv6.olsr_node.enable=1
+ uci_commitverbose "Setup auto-ipv6 for dhcpv6 mode" autoipv6
+fi
+
+
+
config_get addnhosts dnsmasq addnhosts
if [ -z "${addnhosts/\var\/etc\/hosts.olsr/}" ]; then
uci add_list dhcp.dnsmasq.addnhosts="/var/etc/hosts.olsr"
+ if [ "$profile_ipv6" = 1 ]; then
+ uci add_list dhcp.dnsmasq.addnhosts="/var/etc/hosts.olsr.ipv6"
+ fi
fi
uci_commitverbose "Setup dnsmasq" dhcp
config_foreach handle_firewall $section
done
done
+
+# If we use auto-ipv6-dhcp then allow 547/udp on the freifunk zone
+if [ "$profile_ipv6_config" = "auto-ipv6-dhcpv6" ]; then
+ uci batch <<- EOF
+ firewall.dhcpv6=rule
+ firewall.dhcpv6.src=freifunk
+ firewall.dhcpv6.target=ACCEPT
+ firewall.dhcpv6.dest_port=547
+ firewall.dhcpv6.proto=udp
+ EOF
+fi
+
uci_commitverbose "Setup rules, forwardings, advanced config and includes." firewall
--- /dev/null
+#!/bin/sh
+
+[ ! "$(uci -q get network.lan)" == "interface" ] && exit
+
+. /etc/functions.sh
+. $dir/functions.sh
+
+# Setup IPv6 for the lan interface
+
+local ip6addr=""
+if [ "$profile_ipv6_config" = "auto-ipv6-dhcpv6" ]; then
+ # get lan mac
+ local device="$(uci -p/var/state -q get network.lan.ifname)"
+ if [ -n "device" ]; then
+ ip6addr="$($dir/helpers/gen_auto-ipv6-dhcpv6-ip.sh $device)"
+ fi
+ uci set network.lan.ip6addr="${ip6addr}/112"
+fi
+
+uci_commitverbose "Setup ipv6 address for lan" network
set network.$netrenamed.netmask="$netmask"
EOF
+# Setup IPv6 for the interface
+local ip6addr
+if [ "$profile_ipv6" = 1 ]; then
+ if [ "$profile_ipv6_config" = "auto-ipv6-dhcpv6" ]; then
+ # get interface mac
+ local device="$(uci -p/var/state -q get network.$netrenamed.ifname)"
+ if [ -n "device" ]; then
+ ip6addr="$($dir/helpers/gen_auto-ipv6-dhcpv6-ip.sh $device)"
+ fi
+ uci set network.$netrenamed.ip6addr="${ip6addr}/112"
+ fi
+fi
+
uci_commitverbose "Setup interface $netrenamed" network
# setup dhcp alias/interface
. /etc/functions.sh
. $dir/functions.sh
-# Rename interface defaults
+#Rename olsrd basic settings
+handle_olsrd() {
+ if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then
+ section_rename olsrd $1 olsrd
+ fi
+}
+config_load olsrd
+config_foreach handle_olsrd olsrd
+# Rename interface defaults
handle_interfacedefaults() {
if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then
section_rename olsrd $1 InterfaceDefaults
fi
}
-config_load olsrd
config_foreach handle_interfacedefaults InterfaceDefaults
+# Set basic olsrd settings
+if [ "profile_ipv6" = 1 ]; then
+ uci set olsrd.olsrd.IpVersion="6and4"
+fi
+uci_commitverbose "Setup olsr basic settings" olsrd
+
+
# Setup new InterfaceDefaults
uci set olsrd.InterfaceDefaults=InterfaceDefaults
set_defaults "olsr_interfacedefaults_" olsrd.InterfaceDefaults
--- /dev/null
+#!/bin/sh
+. $dir/functions.sh
+
+if [ "$profile_ipv6" = 1 ]; then
+ uci batch <<- EOF
+ set uhttpd.main.listen_http=":80"
+ set uhttpd.main.listen_https=:"443"
+ EOF
+fi
+
+uci_commitverbose "Setup uhttpd" uhttpd
+
. /etc/functions.sh
echo "
-/* Meshwizard 0.0.4 */
+/* Meshwizard 0.0.7 */
"
# config
$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