2 次代码提交 a9e37c0b01 ... 2b4dade85c

作者 SHA1 备注 提交日期
  Dennis Juhler Aagaard 2b4dade85c Added a readme file 1 年之前
  Dennis Juhler Aagaard df17ca9cf1 Edited the copyright text 1 年之前
共有 2 个文件被更改,包括 78 次插入1 次删除
  1. 77 0
      README.md
  2. 1 1
      RetreiveUnifiAPMAC.sh

+ 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.

+ 1 - 1
RetreiveUnifiAPMAC.sh

@@ -32,7 +32,7 @@ SSH_PASSWORD="your-password"                        # Replace with your SSH pass
 
 #####   License is BSD 0-Clause                                         #################################
 
-# Copyright (C) [year] by [copyright holder] <[email]>                  #################################
+# Copyright (C) 2024 by 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.                    #################################