Skip to content
Snippets Groups Projects
Commit b0974e0a authored by Adrian Schmutzler's avatar Adrian Schmutzler Committed by Tim Niemeyer
Browse files

fff-network: Prevent resetting network config on each reboot


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: default avatarAdrian Schmutzler <freifunk@adrianschmutzler.de>

Tested-by: default avatarAdrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: default avatarTobias Klaus <tk+ff@meskal.net>
parent 21a58527
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
BOARD="$(uci get board.model.name)" BOARD="$(uci get board.model.name)"
. /etc/network.$BOARD . /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 }') SWITCHHW=$(swconfig list | awk '{ print $4 }')
...@@ -62,10 +62,9 @@ if ! uci get network.$SWITCHDEV.ifname; then ...@@ -62,10 +62,9 @@ if ! uci get network.$SWITCHDEV.ifname; then
fi fi
uci commit uci commit
/etc/init.d/network restart
fi fi
if [ "$ONE_PORT" = "YES" ]; then if [ "$ONE_PORT" = "YES" ] && ( ! uci -q get network.$SWITCHDEV.ifname || [ "$FORCEPARSE" = '1' ] ) ; then
uci set network.$SWITCHDEV=interface uci set network.$SWITCHDEV=interface
uci set network.$SWITCHDEV.ifname=$SWITCHDEV uci set network.$SWITCHDEV.ifname=$SWITCHDEV
if [ "$ETHMODE" = "WAN" ]; then if [ "$ETHMODE" = "WAN" ]; then
...@@ -97,9 +96,10 @@ if [ "$ONE_PORT" = "YES" ]; then ...@@ -97,9 +96,10 @@ if [ "$ONE_PORT" = "YES" ]; then
ETH0MAC="w2ap" ETH0MAC="w2ap"
fi fi
uci commit uci commit
/etc/init.d/network restart
fi fi
/etc/init.d/network restart
if [[ -n "$ETHMESHMAC" ]]; then if [[ -n "$ETHMESHMAC" ]]; then
if uci get network.ethmesh.macaddr if uci get network.ethmesh.macaddr
then then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment