firmware/src/packages/fff/fff-node-config/files/etc/uci-defaults/23-network-node

43 lines
1.2 KiB
Bash

#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
. /lib/functions/fff/interfaces
## Add batman interfaces
uci batch <<-__EOF__
set network.bat0='interface'
set network.bat0.proto='batadv'
set network.bat0.gw_mode='client'
set network.bat0.gw_sel_class='1'
set network.bat0.network_coding='0'
set network.bat0.aggregated_ogms='1'
set network.bat0.ap_isolation='0'
set network.bat0.bonding='0'
set network.bat0.fragmentation='1'
set network.bat0.orig_interval='1000'
set network.bat0.distributed_arp_table='1'
set network.bat0.hop_penalty='30'
set network.ethmesh='interface'
set network.ethmesh.proto='batadv_hardif'
set network.ethmesh.master='bat0'
__EOF__
## Fix ethmesh mac-address, if necessary
if [ -n "$ETHMESHMAC" ]; then
uci set network.ethmesh.macaddr=$ETHMESHMAC
uci commit network
/etc/init.d/network restart
fi
if [ ! -s /etc/network.config ] ; then
# Write network.config
if [ "$ONE_PORT" = "YES" ] || [ -n "$ETHPORT" ] ; then
echo "ETHMODE='CLIENT' # use BATMAN, CLIENT or WAN" >> /etc/network.config
fi
if [ -n "$TWO_PORT" ] ; then
echo "LAN0MODE='WAN' # use BATMAN, CLIENT or WAN" >> /etc/network.config
echo "LAN1MODE='CLIENT' # use BATMAN, CLIENT or WAN" >> /etc/network.config
fi
fi