From 7dfb71fc1836621aadb5511b66984632a59b4b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Thu, 6 Jan 2022 13:23:53 +0100 Subject: [PATCH] Remove network.mode file --- .../fff/fff-network/mips/network.mode | 30 ------------------- .../files/etc/uci-defaults/23-network-node | 11 +++++++ .../files/usr/sbin/configurenetwork | 9 ------ .../fff/fff-support/files/usr/sbin/show_info | 1 - .../files/www/ssl/cgi-bin/ports.html | 2 -- 5 files changed, 11 insertions(+), 42 deletions(-) delete mode 100644 src/packages/fff/fff-network/mips/network.mode diff --git a/src/packages/fff/fff-network/mips/network.mode b/src/packages/fff/fff-network/mips/network.mode deleted file mode 100644 index f3a27939..00000000 --- a/src/packages/fff/fff-network/mips/network.mode +++ /dev/null @@ -1,30 +0,0 @@ -################ -## This file is used to configure the behavior of network interfaces -## if the routers interfaces differ from the standard WAN+4LAN-Ports -## +2Wireless APs. -## If you want to change their behavior, you should edit the file -## /etc/network.config -## After that you have to reboot the router with following command. -#reboot -# -### The canonical syntax of this file is: -#SPECIFIER="MODE" -### MODES -## Generally there are 3 operating modes for network interfaces in fff. -#BATMAN: The interface is used to mesh with other fff-nodes -#WAN: The interface is used to connect to supernodes via vpn and -# ordinary internet. -#CLIENT: The interface is used to connect clients to the fff-net -## -### SPECIFIER -## For devices only including one ethernet port the specifier is called -## ETHMODE. The default mode for these devices is "BATMAN". -## For example this is the case for: gl-ar150, tl-mr3020-v1, tl-wa850re-v1, -## tl-wa860re-v1, tl-wa901nd-v2, ubnt-bullet-m, ubnt-loco-m-xw, ubnt-nano-m, -## ubnt-unifi -ETHMODE="CLIENT" -## Devices featuring 2 ethernet ports are configured by SPECIFIERs ressembling -## the labels on the PORT itself. For the cpe210 these are called LAN0 and LAN1. -## Therefore they are configured as follows: -LAN0MODE="WAN" -LAN1MODE="CLIENT" diff --git a/src/packages/fff/fff-node-config/files/etc/uci-defaults/23-network-node b/src/packages/fff/fff-node-config/files/etc/uci-defaults/23-network-node index ccb9e52f..4246529b 100644 --- a/src/packages/fff/fff-node-config/files/etc/uci-defaults/23-network-node +++ b/src/packages/fff/fff-node-config/files/etc/uci-defaults/23-network-node @@ -29,3 +29,14 @@ if [ -n "$ETHMESHMAC" ]; then 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 diff --git a/src/packages/fff/fff-node-config/files/usr/sbin/configurenetwork b/src/packages/fff/fff-node-config/files/usr/sbin/configurenetwork index e2f82cc4..548b0f65 100755 --- a/src/packages/fff/fff-node-config/files/usr/sbin/configurenetwork +++ b/src/packages/fff/fff-node-config/files/usr/sbin/configurenetwork @@ -14,15 +14,6 @@ BATMAN_PORTS="$(get_cpu_port) $BATMAN_PORTS" if [ -s /etc/network.config ] ; then . /etc/network.config -else - # Write network.config - if [ "$ONE_PORT" = "YES" ] || [ -n "$ETHPORT" ] ; then - echo "ETHMODE='$ETHMODE' # use BATMAN, CLIENT or WAN" >> /etc/network.config - fi - if [ -n "$TWO_PORT" ] ; then - echo "LAN0MODE='$LAN0MODE' # use BATMAN, CLIENT or WAN" >> /etc/network.config - echo "LAN1MODE='$LAN1MODE' # use BATMAN, CLIENT or WAN" >> /etc/network.config - fi fi if [ "$ONE_PORT" = "YES" ]; then diff --git a/src/packages/fff/fff-support/files/usr/sbin/show_info b/src/packages/fff/fff-support/files/usr/sbin/show_info index 6bbac2e7..d53f66dc 100755 --- a/src/packages/fff/fff-support/files/usr/sbin/show_info +++ b/src/packages/fff/fff-support/files/usr/sbin/show_info @@ -222,7 +222,6 @@ else echo "-> PORT ASSIGNMENT" if [ -n "$ONE_PORT" ] || [ -n "$ETHPORT" ] ; then # Device has a port set by $ETHMODE - . /etc/network.mode . /etc/network.config echo "Port Modus: $ETHMODE" fi diff --git a/src/packages/fff/fff-web-ui/files/www/ssl/cgi-bin/ports.html b/src/packages/fff/fff-web-ui/files/www/ssl/cgi-bin/ports.html index b6f275e4..6c347b5d 100755 --- a/src/packages/fff/fff-web-ui/files/www/ssl/cgi-bin/ports.html +++ b/src/packages/fff/fff-web-ui/files/www/ssl/cgi-bin/ports.html @@ -152,7 +152,6 @@ format_port() { <% if [ -n "$ONE_PORT" ] || [ -n "$ETHPORT" ] ; then %> <% # Device has a port set by $ETHMODE - . /etc/network.mode . /etc/network.config %> @@ -189,7 +188,6 @@ format_port() { <% if [ -n "$TWO_PORT" ] ; then %> <% # Device has two ports - . /etc/network.mode . /etc/network.config %>