1

我正在尝试通过在 cron 中运行 shell 脚本来更改我的 MAC 地址。乌布努图 10.10。克隆线:

40 16 * * * /root/proj/changeMAC.sh > /root/proj/log.txt

更改MAC.sh:

#!/bin/bash
. $HOME/.profile
. $HOME/.bashrc
ifconfig eth0 down
ifconfig eth0 hw ether XX:XX:XX:XX:XX:XX
ifconfig eth0 up
dhclient eth0

其中 XX:XX:XX:XX:XX:XX 是一个真实的 MAC 地址。当它运行时,MAC 地址不会改变。是什么赋予了?

4

1 回答 1

3

ifconfig&dhclient可能不在通常的路径中。尝试使用/sbin/ifconfig/sbin/dhclient

于 2012-05-04T20:56:31.577 回答