macOS using Terminal to toggle WiFi on and off
These commands are enclosed in shell functions but can be run on their own.
wifi_on() {
networksetup -setairportpower en0 on
}
wifi_off() {
networksetup -setairportpower en0 off
}
These commands are enclosed in shell functions but can be run on their own.
wifi_on() {
networksetup -setairportpower en0 on
}
wifi_off() {
networksetup -setairportpower en0 off
}