Installation guide

11
OCTET_B=`uci show network.wifi0.ipaddr | cut -d = -f2 | cut -d . -f2`
OCTET_C=`uci show network.wifi0.ipaddr | cut -d = -f2 | cut -d . -f3`
OCTET_D=`uci show network.wifi0.ipaddr | cut -d = -f2 | cut -d . -f4`
cp /etc/config-mesh/* /etc/config/
uci set network.wifi0.ipaddr=$OCTET_A.$OCTET_B.$OCTET_C.$OCTET_D
uci set network.lan.ipaddr=172.30.$OCTET_D.1
uci set network.lan.netmask=255.255.255.0
uci set network.lan.dns=172.30.$OCTET_D.1
uci set network.lan.gateway=172.30.$OCTET_D.1
uci set batmand.general.announce=172.30.$OCTET_D.0/24
uci set batmand.general.disable_client_nat=true
uci set batmand.general.routing_class=1
uci set batmand.general.gateway_class=0
uci set
batmand.general.visualisation_srv=$OCTET_A.$OCTET_B.$OCTET_C.1
uci commit
uci show
killall udhcpc
killall udhcpd
sleep 3
echo "Generating /etc/udhcpd.conf"
echo "start 172.30.$OCTET_D.100" > /etc/udhcpd.conf
echo "end 172.30.$OCTET_D.200" >> /etc/udhcpd.conf
echo "interface eth0" >> /etc/udhcpd.conf
echo "max_leases 100" >> /etc/udhcpd.conf
echo "opt dns 141.1.1.1" >> /etc/udhcpd.conf
echo "option subnet 255.255.255.0" >> /etc/udhcpd.conf
echo "opt router 172.30.$OCTET_D.1" >> /etc/udhcpd.conf
echo "option dns 141.1.1.1" >> /etc/udhcpd.conf
echo "option domain local" >> /etc/udhcpd.conf
echo "option lease 864000" >> /etc/udhcpd.conf
sleep 1
rm /etc/rc.d/S99udhcpc
echo "mkdir /var/run/udhcpd.leases" > /etc/init.d/udhcpd
echo "udhcpd -f /etc/udhcpd.conf &" >> /etc/init.d/udhcpd
chmod +x /etc/init.d/udhcpd