meta-digi-dey: Fix ifup script for manual configuration.
The system freezes if we try to set the MAC addresses before the interface is up, so check the state before doing it. https://jira.digi.com/browse/DEL-509 Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
This commit is contained in:
parent
e04b4329ab
commit
698df28ed6
|
|
@ -34,14 +34,18 @@ if [ -h /sys/class/net/eth0 ]; then
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if [ "${macaddr}" ]; then
|
if [ "${macaddr}" ]; then
|
||||||
/sbin/ifconfig eth0 hw ether ${macaddr}
|
if /sbin/ifconfig eth0 | grep -qs UP; then
|
||||||
|
/sbin/ifconfig eth0 hw ether ${macaddr}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -h /sys/class/net/eth1 ]; then
|
if [ -h /sys/class/net/eth1 ]; then
|
||||||
macaddr=`cat /proc/cmdline | sed 's,\s,\n,g' | awk '/ethaddr3/ {print}' | sed 's,ethaddr3=,,g'`
|
macaddr=`cat /proc/cmdline | sed 's,\s,\n,g' | awk '/ethaddr3/ {print}' | sed 's,ethaddr3=,,g'`
|
||||||
if [ "${macaddr}" ]; then
|
if [ "${macaddr}" ]; then
|
||||||
/sbin/ifconfig eth1 hw ether ${macaddr}
|
if /sbin/ifconfig eth1 | grep -qs UP; then
|
||||||
|
/sbin/ifconfig eth1 hw ether ${macaddr}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue