[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

patch for live-initramfs live-helpers get_mac()



Hello,

In the live_helpers script,
get_mac() function must return Error when no mac is found,
and Success otherwise

get_mac ()
{
   mac=""
   for adaptor in /sys/class/net/*;do
      status=$(cat ${adaptor}/iflink)
      if [ ${status} -eq 2 ];
      then
         mac=$(cat ${adaptor}/address)
         mac=$(echo ${mac}|sed 's/:/-/g'|tr '[a-z]' '[A-Z]')
         echo ${mac}
         return 0
      fi
   done
   echo ${mac}
   return 1
}

Best regards,

Jordi Pujol



Reply to: