This is a simple bash script and systemd system file for manging mulitple wifi connections on linux. This allows me to maintain a very simple wifi connection state machine that is easy to understand, debug, and customize.
The bash script will look through all conf files in the wpa_supplicant directory, find the highest priority conf where the SSID matches, adjust the wpa_supplicant config, and restart the wpa_supplicant service.
The systemd service is configured to run 5-seconds after resuming from suspend.