Merge pull request #490 from yunfeidog/master

fix(mac): 修复mac无法正确修改接口MAC地址的问题
This commit is contained in:
煎饼果子卷鲨鱼辣椒@86 2025-05-04 16:12:59 +08:00 committed by GitHub
commit 9204cef000
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

1
scripts/run/cursor_mac_id_modifier.sh Normal file → Executable file
View File

@ -110,6 +110,7 @@ _change_mac_for_one_interface() {
# 尝试修改 MAC 地址
log_info "尝试为接口 '$interface_name' 设置 MAC 地址: $random_mac"
sudo ifconfig $interface_name up
if sudo ifconfig "$interface_name" ether "$random_mac"; then
log_info "尝试修改接口 '$interface_name' 的 MAC 地址为: $random_mac [成功]"
local new_mac_check=$(ifconfig "$interface_name" | awk '/ether/{print $2}')