Posted on 08-12-2013 08:32 AM
Hi guys
For security reason i am trying to remove the Wi-Fi network service from Workstations.
If i do it manually in the Network System Pref pane and hit the minus, then it goes away.
If i try this in terminal
networksetup -removenetworkservice Wi-Fi
I get the error
You cannot remove Wi-Fi because there aren't any other network services on Wi-Fi.
Anyone know how i can remove it?
I know i can use this to disable it /usr/sbin/networksetup -setnetworkserviceenabled
but i have a separate script that sets the proxy for every interface and it seems the script cannot set proxy setting for a disabled network interface and it is causing errors.
Posted on 08-12-2013 10:03 AM
The man page for networksetup actually states this for the -removenetworkservice command:
Use this command to delete a network service <networkservice>.
**You cannot use this command to delete the last remaining service for a hardware port.** To do so, you use the -setnetworkserviceenabled command
It sounds like that's what the error you're getting is telling you.
Posted on 08-12-2013 11:31 PM
Yep, thanks Mike but like I said I already new that and didn't know of a better approach or what others did.
I decided to add to part of the proxy script to
1.detect if Wi-Fi was disabled to then reenable it
Do the proxy stuff (thanks Ben Toms)
Disable Wi-Fi again if its not a Laptop