Merge pull request #94 from SeattleMeshnet/some-uci-defaults-fixes

Some uci defaults fixes
This commit is contained in:
Lars 2015-05-03 00:47:12 +02:00
commit 874d309add

View file

@ -18,26 +18,28 @@ EOF
# make sure config is present (might fail for any reason) # make sure config is present (might fail for any reason)
uci get cjdns.cjdns.ipv6 >/dev/null 2>&1 uci get cjdns.cjdns.ipv6 >/dev/null 2>&1
if [ $? -ne 0]; then if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
# enable auto-peering on ethernet # enable auto-peering on ethernet interface lan, if existing
uci show network.lan | grep bridge >/dev/null 2>&1 uci get network.lan | grep interface >/dev/null 2>&1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
# most routers will set up an ethernet bridge for the lan uci get network.lan.type | grep bridge >/dev/null 2>&1
ifname="br-lan" if [ $? -eq 0 ]; then
else # most routers will set up an ethernet bridge for the lan
# docker containers don't have permission to create bridges by default, ifname="br-lan"
# so we bind to the underlying interface instead (likely eth0) else
ifname=`uci get network.lan.ifname` # docker containers don't have permission to create bridges by default,
fi # so we bind to the underlying interface instead (likely eth0)
uci -q batch <<-EOF >/dev/null ifname=`uci get network.lan.ifname`
add cjdns eth_interface fi
set cjdns.@eth_interface[-1].beacon=2 uci -q batch <<-EOF >/dev/null
set cjdns.@eth_interface[-1].bind=$ifname add cjdns eth_interface
set cjdns.@eth_interface[-1].beacon=2
set cjdns.@eth_interface[-1].bind=$ifname
EOF EOF
fi
# set the tun interface name # set the tun interface name
uci set cjdns.cjdns.tun_device=tuncjdns uci set cjdns.cjdns.tun_device=tuncjdns