瀏覽代碼

Added a readme file

Dennis Juhler Aagaard 1 年之前
父節點
當前提交
2b4dade85c
共有 1 個文件被更改,包括 77 次插入0 次删除
  1. 77 0
      README.md

+ 77 - 0
README.md

@@ -0,0 +1,77 @@
+# UniFi Access Point MAC Address Retriever
+
+This script retrieves the 2.4GHz radio MAC addresses of UniFi access points using the UniFi Controller API and SSH. It requires certain dependencies and appropriate credentials to function correctly.
+
+## Prerequisites
+
+Ensure the following applications are installed on your system:
+
+- `bash`
+- `sshpass`
+- `jq`
+- `curl`
+
+## Setup
+
+1. **UniFi Controller Credentials:**
+
+   Update the script with your UniFi Controller credentials and SSH credentials.
+
+   ```bash
+   CONTROLLER_URL="https://your-controller-url:8443"  # Replace with your UniFi Controller Domain name or IP:PORT
+   USERNAME="your-username"                           # Replace with your UniFi Controller username
+   PASSWORD="your-password"                           # Replace with your UniFi Controller password
+   SITE_NAME="default"                                # Replace with your site name if different
+   SSH_USERNAME="your-username"                       # Replace with your SSH username
+   SSH_PASSWORD="your-password"                       # Replace with your SSH password
+   ```
+
+## Usage
+
+1. **Run the Script:**
+
+   Execute the script using bash:
+
+   ```bash
+   ./your-script-name.sh
+   ```
+
+2. **Script Execution:**
+
+   The script will:
+
+   - Check for the required dependencies (`sshpass`, `jq`, `curl`).
+   - Log in to the UniFi Controller to get a session cookie.
+   - Retrieve the site ID from the UniFi Controller.
+   - Get the list of devices from the specified site.
+   - Filter for WiFi access points and retrieve their names and IP addresses.
+   - SSH into each access point to retrieve the 2.4GHz radio MAC address.
+   - Output the access point names and their corresponding 2.4GHz MAC addresses.
+
+## License
+
+This script is licensed under the BSD 0-Clause License.
+
+```
+© 2024 Dennis Juhler Aagaard <dja@radixadm.dk>
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+```
+
+## Author
+
+Script made by Dennis Juhler Aagaard
+
+## Support
+
+If you encounter any issues or have questions, please reach out to [contact email].
+
+## Important Notes
+
+- This script should be used by individuals who are familiar with network administration and have the necessary permissions to access the UniFi Controller and APs.
+- Modify the script beyond the configuration section at your own risk.
+
+## Disclaimer
+
+The author of this script is not liable for any damages or issues that arise from using this script. Use it at your own discretion and ensure you have backups of your configurations and data before proceeding.