Advertisement
Guest User

Untitled

a guest
Aug 5th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. #!/bin/sh -e
  2.  
  3. ifconfig eth0 down
  4. MAC_tmp=$(grep -E "MacAddress=" /sys/class/i2c-dev/i2c-0/device/0-0050/eeprom)
  5. echo "Mac Line: $MAC_tmp"
  6. MAC=$( echo $MAC_tmp | sed 's|MacAddress=||' )
  7.  
  8. if [ -z "$MAC" ]; then
  9.      MAC="02:90:00:a0:90:90"
  10.      echo "Couldnt read Mac Address, falling back to emergency Mac: $MAC"
  11.  fi
  12.  
  13. echo "Setting up eth0 with MAC: $MAC"
  14. ifconfig eth0 hw ether $MAC up
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement