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,15 +34,19 @@ if [ -h /sys/class/net/eth0 ]; then
|
|||
;;
|
||||
esac
|
||||
if [ "${macaddr}" ]; then
|
||||
if /sbin/ifconfig eth0 | grep -qs UP; then
|
||||
/sbin/ifconfig eth0 hw ether ${macaddr}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -h /sys/class/net/eth1 ]; then
|
||||
macaddr=`cat /proc/cmdline | sed 's,\s,\n,g' | awk '/ethaddr3/ {print}' | sed 's,ethaddr3=,,g'`
|
||||
if [ "${macaddr}" ]; then
|
||||
if /sbin/ifconfig eth1 | grep -qs UP; then
|
||||
/sbin/ifconfig eth1 hw ether ${macaddr}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue