Tuesday, December 27, 2016

Mac OS X: Enable and disable wifi from the shell

Enable and disable wifi from the shell in Max OS X.

networksetup -setairportpower en0 on
networksetup -setairportpower en0 off

Consider wrapping that in an alias in your .bash_profile or .profile.

alias wifion="networksetup -setairportpower en0 on"
alias wifioff="networksetup -setairportpower en0 off"

No comments:

Post a Comment