macOS系统定时关闭和开启本地网络
检查网络接口名称:
networksetup -listallhardwareports
Hardware Port: PX88888A 3
Device: en10
Hardware Port: Wi-Fi
Device: en1
以下内容加入: crontab -e
# Wifi
0 19 * * * /usr/sbin/networksetup -setairportpower en1 off
0 7 * * * /usr/sbin/networksetup -setairportpower en1 on
# 本地网络
0 19 * * * /usr/sbin/networksetup -setnetworkserviceenabled "PX88888A 3" off
0 7 * * * /usr/sbin/networksetup -setnetworkserviceenabled "PX88888A 3" on