Merge pull request #656 from nlhintz/pull-request
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / helpers / setup_lan_ipv6.sh
1 #!/bin/sh
2
3 [ ! "$(uci -q get network.lan)" == "interface" ] && exit
4
5 . /lib/functions.sh
6 . $dir/functions.sh
7
8 # Setup IPv6 for the lan interface
9
10 ip6addr=""
11 if [ "$ipv6_config" = "auto-ipv6-dhcpv6" ]; then
12         # get lan mac
13         device="$(uci -p/var/state -q get network.lan.ifname)"
14         if [ -n "device" ]; then
15                 ip6addr="$($dir/helpers/gen_auto-ipv6-dhcpv6-ip.sh $device)"
16         fi
17         uci set network.lan.ip6addr="${ip6addr}/112"
18 fi
19
20 uci_commitverbose "Setup ipv6 address for lan" network