https://github.com/blakek/macos-wifi-reconnect
A simple way to make sure macOS reconnects to a certain Wi-Fi network
https://github.com/blakek/macos-wifi-reconnect
Last synced: about 1 month ago
JSON representation
A simple way to make sure macOS reconnects to a certain Wi-Fi network
- Host: GitHub
- URL: https://github.com/blakek/macos-wifi-reconnect
- Owner: blakek
- Created: 2022-10-21T16:03:42.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-31T12:42:24.000Z (over 3 years ago)
- Last Synced: 2025-11-12T13:23:45.391Z (9 months ago)
- Language: Shell
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# macos-wifi-reconnect
> 📶 Reconnects to a Wi-Fi network if the connection is lost.
This is a simple script that runs in the background and checks if the Wi-Fi connection has a network connection. If not, it just turns Wi-Fi off and on again to reconnect.
I wrote this because I'm using an older MacBook Air as a server. When the router is restarted, Wi-Fi is not automatically reconnected for some reason. I tried fixing using macOS' built-in Wi-Fi settings, but it didn't work.
If you have a newer system (maybe macOS 11+?), there's an [earlier implementation of this script](https://github.com/blakek/macos-wifi-reconnect/tree/4dbecd4141df7e76673fde0b8616368d2d5c1858) that uses `airportd` instead of `networksetup`. It can connect to a specific network without needing the network password (if you've connected to it before).
## Install
**Installing from source:**
1. Either [clone this repository](https://help.github.com/articles/cloning-a-repository/) or [download the ZIP file](https://github.com/blakek/macos-wifi-reconnect/archive/main.zip)
2. Build from the Makefile:
> **Note:**
> You'll see these running make as root. This is because powering on/off Wi-Fi from the terminal requires root privileges for some reason :shrug:
```bash
sudo make install
```
3. Reboot _or_ load the LaunchAgent using Make:
```bash
sudo make load
```
## License
MIT