Everything related to EV-04 Alarm push buttons.

Dennis Juhler Aagaard ab79a4115a Typo hace 1 año
README.md ab79a4115a Typo hace 1 año
RetreiveUnifiAPMAC.sh df17ca9cf1 Edited the copyright text hace 1 año

README.md

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.

This script is considered CRUEL and DANGEROUS. It will contain your password for your Unifi system as clear text. Visible for everyone. No doubt that it can be made more safe to use. This is a quick tool for retreiving your broadcast WiFi radio MAC Addresses. Used for the EV-04 Alarm push button and similar.

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.

   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:

   ./RetreiveUnifiAPMAC.sh
  1. 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.