Posts: 20
leke
Joined: 29 Aug 2011
#1
Hi, I was wondering if anyone knew why my script to change my mac address doesn't work on Antix. It works ok in ubuntu...

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!!!
Thanks.
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#2
Try putting the script in /usr/local/bin

Actually no need. I just ran it from user directory as root user, I called the script testing.sh and ran in a root terminal ./testing.sh and it works.
Posts: 200
lagopus
Joined: 15 Oct 2008
#3
leke,
The script works!
The script simply says:"I do not find the eth0 interface"

As root type:
# ifconfig -a

You should get:

Code: Select all

root@antiX:/home/yves# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 08:xx:xx:xx:xx  
          inet addr:10.x.x.x  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:59 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6676 (6.5 KiB)  TX bytes:5694 (5.5 KiB)
          Interrupt:10 Base address:0xd020 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
You can check if the system found your ethernet card:

Code: Select all

root@antiX:/home/yves# dmesg | grep eth
eth0: registered as PCnet/FAST III 79C973
Posts: 20
leke
Joined: 29 Aug 2011
#4
lagopus wrote: The script simply says:"I do not find the eth0 interface"
*FacePalm* As soon as I read this, I realised I needed to change eth0 to wlan0. Yep, works fine now.
Sorry for the moment of dizziness __{{emoticon}}__