Advertisement
opexxx

random_mac.sh

Mar 31st, 2015
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.75 KB | None | 0 0
  1. #!/bin/bash
  2.   export PURPLE="\e[01;35m"
  3.   export Z="\e[0m"
  4.   export BLUE="\e[01;34m"
  5.  
  6.   echo -e $PURPLE "Genierere zufällige MAC-Adresse"
  7.  
  8.   a1=`cat /dev/urandom | tr -dc 'a-fA-F0-9' | fold -w 2 | head -n 1`
  9.   a2=`cat /dev/urandom | tr -dc 'a-fA-F0-9' | fold -w 2 | head -n 1`
  10.  a3=`cat /dev/urandom | tr -dc 'a-fA-F0-9' | fold -w 2 | head -n 1`
  11.  a4=`cat /dev/urandom | tr -dc 'a-fA-F0-9' | fold -w 2 | head -n 1`
  12.  a5=`cat /dev/urandom | tr -dc 'a-fA-F0-9' | fold -w 2 | head -n 1`
  13.  a6=`cat /dev/urandom | tr -dc 'a-fA-F0-9' | fold -w 2 | head -n 1`
  14.  
  15.  ifconfig eth0 down
  16.  ifconfig eth0 hw ether $a1":"$a2":"$a3":"$a4":"$a5":"$a6
  17.  ifconfig eth0 up
  18.  echo -e $BLUE "neue MAC-Adresse lautet:" $a1":"$a2":"$a3":"$a4":"$a5":"$a6
  19.  echo -e $Z
  20.  exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement