ConnectMeHub is an open-source project designed exclusively for macOS users, simplifying Wi-Fi network management on this platform. It allows macOS users to seamlessly connect to specified Wi-Fi networks, ensuring a reliable and hassle-free network experience.
- Automatically connects to a list of preferred Wi-Fi networks.
- Supports fallback to a backup network if the primary networks are unavailable.
- Passwords are securely stored in the macOS Keychain for enhanced security.
ConnectMeHub is designed exclusively for macOS users. It takes advantage of macOS-specific features to simplify Wi-Fi network management on this platform.
Please note that this script is not compatible with other operating systems.
To allow osascript
to access the keychain and retrieve stored Wi-Fi passwords, follow these steps:
-
Open the "Keychain Access" application on your macOS.
-
Select the "Login" keychain on the left sidebar.
-
Search for the Keychain (Wi-Fi Name) that contains the Wi-Fi password and Select it.
-
Select the "Access Control" tab.
-
Click the "+" button to add an application to the list.
-
Navigate to
/usr/bin/osascript
and select it. -
Click "Add" to grant
osascript
access to the keychain items.
To get started with ConnectMeHub on macOS, follow these simple steps:
- Clone the repository to your local machine.
git clone https://github.com/mohamedawnallah/ConnectMeHub.git
- Open the project in your favorite code editor or script runner.
- Customize the network configurations in the script by modifying the
mainNetworkSSIDs
andbackupNetworkSSIDs
properties. For example:
-- Example: Customize the list of preferred networks
property mainNetworkSSIDs : {"MyHomeNetwork", "OfficeWiFi", "CafeFreeWiFi"}
-- Example: Set a backup network
property backupNetworkSSIDs : {"BackupNetwork"}
Run the script by executing the main() function.
osascript ConnectMeHub.scpt
You can configure ConnectMeHub to run periodically using the crontab. Here's an example of how to set it up:
- Open Terminal on your macOS.
- Open your crontab configuration by running:
crontab -e
- Add the following line to run ConnectMeHub every minute:
* * * * * osascript path/to/ConnectMeHub.scpt
This schedule runs ConnectMeHub every minute. However, you can customize the cron schedule to match your specific needs. The format for the cron schedule is as follows:
- The five asterisks (*) represent the minute, hour, day of the month, month, and day of the week fields, respectively.
- You can adjust the values in these fields to determine when ConnectMeHub runs.
- Refer to the Crontab documentation for more information on customizing your cron schedule.
After customizing your schedule, save and exit the crontab configuration to apply the changes.
ConnectMeHub will now run according to your specified schedule, automatically managing your Wi-Fi connections at the desired intervals.
ConnectMeHub simplifies the process of connecting to preferred Wi-Fi networks on macOS. It automatically detects the current network and switches to a specified network if available. If no suitable network is found, it displays a notification.
Contributions to ConnectMeHub are welcome! If you have suggestions for improvements, new features, or would like to add support for other operating systems (such as Windows, Ubuntu, etc.), please open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.