A simple WiFi prioritizer script for Rocky Linux. It scans the wifi every minute and connect to the prioritised WiFi. Note, this is very unsecure for production levels. Use with caution!
Make sure to create /etc/wifi-priorities.conf
file and write the wifi names that you would love to connect with. The order defines the priority of the wifi connection
/etc/wifi-priorities.conf
MyFirstWifi
MySecondWIfi
If the device is connected to the first wifi, it won't reconnect. If the devices is connected to the second wifi, it will connect to the first wifi incase it exists.
- Copy the
wifi-prioritizerd.service
file to/etc/systemd/system/
directory. - Copy the
wifi-prioritizerd
file to/sbin/
directory - Change the
wifi-prioritizerd
privilages if needed (chmod 755 wifi-prioritizerd
). - Reload systemd services scripts using
systemctl daemon-reload
- Enable the
wifi-prioritizerd
service by usingsystemctl enable wifi-prioritizerd.service
- Start the service using
systemctl start wifi-prioritizerd
- Make sure that the
/etc/wifi-priorities.conf
file exist in your filesystm. - Logs for the service can be found at
/var/log/wifi-prioritizerd.log
- This script has been tested on Arm64 Rocky linux (on raspberry pi).