From 410b8fe9a2a1212a5898460c99a8077e2c34bdd9 Mon Sep 17 00:00:00 2001 From: Tim Niemeyer Date: Sun, 17 Aug 2014 14:56:31 +0200 Subject: [PATCH] bsp/def/network.sh: use restart and wait before reading macs Signed-off-by: Tim Niemeyer --- bsp/default/root_file_system/etc/network.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bsp/default/root_file_system/etc/network.sh b/bsp/default/root_file_system/etc/network.sh index 24a30b91..bded7e53 100644 --- a/bsp/default/root_file_system/etc/network.sh +++ b/bsp/default/root_file_system/etc/network.sh @@ -54,7 +54,7 @@ if ! uci get network.$SWITCHDEV.ifname; then fi uci commit - /etc/init.d/network reload + /etc/init.d/network restart fi if [[ -n "$ETHMESHMAC" ]]; then @@ -63,13 +63,14 @@ if [[ -n "$ETHMESHMAC" ]]; then echo "MAC for ethmesh is set already" else echo "Fixing MAC on eth0.3 (ethmesh)" + sleep 10 NEW_MACADDR=$(cat /sys/class/net/$ETHMESHMAC/address) uci set network.ethmesh.macaddr=$NEW_MACADDR uci commit ifconfig eth0.3 down ifconfig eth0.3 hw ether $NEW_MACADDR ifconfig eth0.3 up - /etc/init.d/network reload + /etc/init.d/network restart fi fi @@ -79,12 +80,13 @@ if [[ -n "$ROUTERMAC" ]]; then echo "MAC for mesh is set already" else echo "Fixing MAC on br-mesh (mesh)" + sleep 10 NEW_MACADDR=$(cat /sys/class/net/$ROUTERMAC/address) uci set network.mesh.macaddr=$NEW_MACADDR uci commit ifconfig br-mesh down ifconfig br-mesh hw ether $NEW_MACADDR ifconfig br-mesh up - /etc/init.d/network reload + /etc/init.d/network restart fi fi