On FreeBSD/Linux, it is possible to restart network services by restarting a daemon.
Is there something similar in macOS Sierra?
You can tear down and start up the network interface using:
sudo ifconfig en0 down
sudo ifconfig en0 up
The restarts Wi-Fi without sudo
. Does anyone know how to do this with a single command?
networksetup -setairportpower en0 off
networksetup -setairportpower en0 on
&&
like so: networksetup -setairportpower en0 off && networksetup -setairportpower en0 on
for single command.
Commented
Mar 26, 2019 at 12:43