I want to know how to control (specifically turn off) the networking (specifically AirPort - I want to turn off the radio) from the command line (specifically from bash in Terminal.app, being run by me) as a user (no sudo privileges or admin priviliges). You CAN turn off AirPort as a user, but I need to do this from the command line – as a user.
Asked
Active
Viewed 6,947 times
1 Answers
9
See OSX Daily - Enable and Disable AirPort Wireless from the Command Line in Mac OS X. Quote:
Turn Airport Off via Command Line
networksetup -setairportpower airport offTurn Airport On via Command Line
networksetup -setairportpower airport onYou won’t see any confirmation in the Terminal that the command succeeded or failed, but if you watch the AirPort menu icon you will see the bars disappear indicating the wireless interface is turned off, or reappear indicating that wireless is activated again.
NOTE: In OS X Lion, use the hardware name above instead of airport,
e.g. networksetup -setairportpower en1 off.
Chris W. Rea
- 4,409
airportwith the network adapter name their computer uses. For my MacBook Pro, it'sen1. – Cajunluke Mar 31 '12 at 00:54en1. To find out what it is on your computer, you can use eithernetworksetup -listallhardwareportsorifconfig. – mhucka Nov 20 '12 at 01:19