From: Jan Paul Tuecking Date: Thu, 16 Jul 2009 15:58:31 +0000 (+0200) Subject: New mac address will be set on startup/reboot X-Git-Tag: v2.5-core29~38 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=b8c750f3b354307eaa52f6cf3d468fb775b15c78;hp=cbba8fc937c13c3e72b0915d896108f3229ddf0a New mac address will be set on startup/reboot --- diff --git a/src/initscripts/init.d/networking/red b/src/initscripts/init.d/networking/red index f90e07378d..5c96c06911 100644 --- a/src/initscripts/init.d/networking/red +++ b/src/initscripts/init.d/networking/red @@ -26,6 +26,9 @@ if [ "$RRDLOG" == "" ]; then fi eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings) +eval $(/usr/local/bin/readhash /var/ipfire/mac/settings) + +MAC=$(tr - : <<<$MAC) TYPE="${RED_TYPE}" DEVICE="${RED_DEV}" @@ -87,6 +90,11 @@ case "${1}" in link_status=`ip link show ${DEVICE} 2> /dev/null` if [ -n "${link_status}" ]; then if ! echo "${link_status}" | grep -q UP; then + if [ -n "$MAC" ]; then + boot_mesg "Setting mac address on ${DEVICE} to ${MAC}" + ip link set dev ${DEVICE} address ${MAC} + evaluate_retval + fi ip link set ${DEVICE} up fi fi @@ -122,10 +130,7 @@ case "${1}" in evaluate_retval run_subdir ${rc_base}/init.d/networking/red.up/ - - # Configure aliases only if red static - /usr/local/bin/setaliases - + elif [ "${TYPE}" == "DHCP" ]; then if [ -e $LEASEINFO ]; then