欢迎各位兄弟 发布技术文章
这里的技术是共享的
#!/bin/bash
#
#网卡名称
EnX=$(/usr/bin/osascript -e 'display dialog "请输入网卡名称" default answer "" with icon note buttons {"Cancel", "Continue"} default button "Continue"
set result1 to result
set the text_data to text returned of the result
set the button_data to button returned of the result1
if button_data = "Cancel" then
return ""
end if
return text_data')
sudo ifconfig $EnX ether A4:BB:6D:E6:AE:FF
networksetup -detectnewhardware
sudo ifconfig $EnX up
(/usr/bin/osascript -e 'display dialog "修改成功!"')