Code: Select all
#!/bin/bash
echo"HELLO!"
ifconfig eth0 | grep HWaddr
ifconfig eth0 down
ifconfig eth0 hw ether 00:B0:D0:86:BB:F7
ifconfig eth0 up
echo""
ifconfig eth0 | grep HWaddr
echo"BYEEE!!!"
Code: Select all
root@XP:/home/asdf# bash sh.sh
HELLO!
eth0: error fetching interface information: Device not found
eth0: ERROR while getting interface flags: No such device
SIOCSIFHWADDR: No such device
eth0: ERROR while getting interface flags: No such device
eth0: error fetching interface information: Device not found
BYEEE!!!