Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
macOS wifi auto disconnect & reconnect
# 用法:在本地创建该文件
# 设置权限:`sudo chmod 755 ./`
# 运行:`sudo ./`
# 用完之后如果网络没恢复,需手动运行 `sudo networksetup -setnetworkserviceenabled Wi-Fi on`
echo "shit network testing tool by tom"
echo " "
while [ true ]
echo "Turning off WiFi…"
networksetup -setnetworkserviceenabled Wi-Fi off
echo "Done, sleep 15 sec"
sleep 15
echo "turning on WiFi…"
networksetup -setnetworkserviceenabled Wi-Fi on
echo "Done, sleep 15 sec"
sleep 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment