Files
meta-mortsgna/recipes-utils/fixmac/fixmac/fixmac.sh
Andreas Müller 6efa47508b Fix typo in path name
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
2018-10-25 12:45:15 +02:00

11 lines
232 B
Bash
Executable File

#!/bin/sh
if [ -e /etc/ethernetmac.$1 ] ; then
MACADDRESS="$(cat /etc/ethernetmac.$1)"
else
MACADDRESS="$(ranpwd -m)"
echo ${MACADDRESS} > /etc/ethernetmac.$1
fi
/sbin/ifconfig $1 hw ether ${MACADDRESS} && /sbin/ifconfig $1 up