[PATCH v5 03/11] fff-network: Prevent resetting network config on each reboot

Tobias Klaus tk+ff at meskal.net
Di Aug 1 00:11:40 CEST 2017


Hey,

sieht gut aus und behebt ein Problem, das mich auch schon echt genervt hat.

Eine kleine Rückfrage inline.

Viele Grüße
Tobias

Am Freitag, 28. Juli 2017, 13:03:32 CEST schrieb Adrian Schmutzler:
> This only sets the switch configs if they are not set yet.
> If the network.* file is edited, add FORCEPARSE=1 to apply
> the changes.
> 
> Fixes #56
> 
> Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> 
> Tested-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> ---
>  src/packages/fff/fff-network/files/usr/sbin/configurenetwork | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
> b/src/packages/fff/fff-network/files/usr/sbin/configurenetwork index
> 63b216a..6f9944a 100755
> --- a/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
> +++ b/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
> @@ -12,7 +12,7 @@
>  BOARD="$(uci get board.model.name)"
>  . /etc/network.$BOARD
> 
> -if ! uci get network.$SWITCHDEV.ifname; then
> +if ! uci -q get network.$SWITCHDEV > /dev/null || [ "$FORCEPARSE" = '1' ] ;
> then
> 
>      SWITCHHW=$(swconfig list | awk '{ print $4 }')
> 
> @@ -65,7 +65,7 @@ if ! uci get network.$SWITCHDEV.ifname; then
>      /etc/init.d/network restart
>  fi
> 
> -if [ "$ONE_PORT" = "YES" ]; then
> +if [ "$ONE_PORT" = "YES" ] && ( ! uci -q get network.$SWITCHDEV.ifname || [
Hier könnte man auch einfach auf "uci -q get network.$SWITCHDEV" testen und 
würde sich dann das uci set 2 Zeilen drunter sparen. Oder übersehe ich das 
was?

> "$FORCEPARSE" = '1' ] ) ; then uci set network.$SWITCHDEV=interface
>      uci set network.$SWITCHDEV.ifname=$SWITCHDEV
>      if [ "$ETHMODE" = "WAN" ]; then




Mehr Informationen über die Mailingliste franken-dev