Author Topic: [bash] show mac address  (Read 396 times)

0 Members and 1 Guest are viewing this topic.

Offline frog

  • Peasant
  • *
  • Posts: 107
  • Reputation: +13
    • View Profile
[bash] show mac address
« on: June 01, 2012, 03:40:06 am »
Code: Bash
  1. #!/bin/bash
  2. ##
  3. ### showmac.sh - display mac address
  4. ##
  5. #
  6. export MACADDR
  7. export IFACE
  8.  
  9. if [ -z $1 ]
  10.   then
  11.     echo "Usage: $0 <interface>"
  12.     echo " Example: $0 wlan1"
  13.     exit
  14. fi
  15.  
  16. IFACE=$1
  17. MACADDR=`ifconfig $IFACE | grep "HW"`
  18.  
  19. echo ${MACADDR:38:18}
  20.  
« Last Edit: June 01, 2012, 10:57:00 pm by frog »
The time-space age has begun. - Andrew Basiago

 



Intern0t SoldierX py1337 SecurityOverride programisiai iExploit
Want to be here? Contact Ande, Bluechill or Kulverstukas on the forum or at IRC.