Hi,
I try to disable any usb, usb-c, or other ways of ethernet and temperately disable it. let wifi run. and then reactive when I finish my script.
any way to find out active ethernet adapter and disable it?
thanks!
Hi,
I try to disable any usb, usb-c, or other ways of ethernet and temperately disable it. let wifi run. and then reactive when I finish my script.
any way to find out active ethernet adapter and disable it?
thanks!
Best answer by ruihere
but even just change the service order, you need to know the name for the adapter?
actually I just found out how to do it:
a=$(networksetup -listnetworkserviceorder |grep 'Hardware Port' |grep '10/100' |grep -o '....$' |cut -c 1-3)
sudo ifconfig $a down
and later when I want it back, I use
sudo ifconfig $a up
maybe this long command can be simplify :)
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.