Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/suuhm/unifi-bulk
Easy to use shell script for mass editing your UniFi devices
https://github.com/suuhm/unifi-bulk
bash bulk edge edns ssh unifi
Last synced: about 11 hours ago
JSON representation
Easy to use shell script for mass editing your UniFi devices
- Host: GitHub
- URL: https://github.com/suuhm/unifi-bulk
- Owner: suuhm
- License: apache-2.0
- Created: 2023-08-07T16:06:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-07T17:48:20.000Z (over 1 year ago)
- Last Synced: 2024-03-15T09:01:33.080Z (10 months ago)
- Topics: bash, bulk, edge, edns, ssh, unifi
- Language: Shell
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unifi-bulk
Easy to use shell script for mass editing your UniFi devices```
_____ __ ___________________ _____________ _____________ __
__ / / /_________(_)__ ____/__(_) ___ __ )_ / / /__ /___ //_/
_ / / /__ __ \_ /__ /_ __ / __ __ | / / /__ / __ ,<
/ /_/ / _ / / / / _ __/ _ / _ /_/ // /_/ / _ /___ /| |
\____/ /_/ /_//_/ /_/ /_/ /_____/ \____/ /_____/_/ |_|=======================================================================
========= UNIFI BULK PROCESSOR & EDNS ENABLER (c) 2023 suuhm ==========
=======================================================================```
Originally, this script was only planned as EDNS helper-script (here is a link to the blog: https://the-suuhmmary.coldwareveryday.com/how-to-relay-client-ips-behind-upstream-dns-servers-with-edns/).
But now it became a relatively useful tool to upgrade and modify as many unifi devices as possible at the same time.
Without the unifi control suite mind you and completely natively tunneled over ssh## How to use
1. Clone the script via
```bash
git clone https://github.com/suuhm/unifi-bulk.git && cd unifi-bulk
chmod +x unifi-bulk.sh
```2. Edit and or add your wished hosts to the `unifi_ap_hosts.lst` file
```lst
#
# HOSTNAME : IP LIST:
# Don't use ':' in your name
# cause of delimititers
#
UNIFI_AP_1:10.1.2.3.4
...
UNIFI_AP_1:10.1.2.3.26
UNIFI_AP_1:10.1.2.3.17
```3. Edit the `unifi-bulk.sh` file:
```bash
#
# CONFIG SECTION
#
HOSTS="unifi_ap_hosts.lst"
UUN="ubnt"
# Plain Text Password
# USE WITH CAUTION!!!
PASSH_WRD="ubnt"
_IP_OF_EDGE_GATEWAY=192.168.1.1
_DNS_PORT=53
```### Important! Don't use plain text passwords!
Use this method here for example root:```bash
echo "YOURPASSWORD" > /root/.unifi_ap.pass; chmod 600 /root/.unifi_ap.pass
# Edit the `unifi-bulk.sh` file:
PASSH_WRD="$(cat /root/.unifi_ap.pass)"
```4. Run Script:
```bash_____ __ ___________________ _____________ _____________ __
__ / / /_________(_)__ ____/__(_) ___ __ )_ / / /__ /___ //_/
_ / / /__ __ \_ /__ /_ __ / __ __ | / / /__ / __ ,<
/ /_/ / _ / / / / _ __/ _ / _ /_/ // /_/ / _ /___ /| |
\____/ /_/ /_//_/ /_/ /_/ /_____/ \____/ /_____/_/ |_|=======================================================================
========= UNIFI BULK PROCESSOR & EDNS ENABLER (c) 2023 suuhm ==========
=======================================================================Usage: ./unifi-bulk.sh [OPTION] <0|1> | = 1 For AUTOLOGINFUNCTION
--get-apinfo Get some info of APs
--set-hosts Setup APs for edns
--run-cmd 0|1 (AUTOLOGIN MUST BE SET!!) ['COMMANDS']|- Run Custom cmmands on AP
--help Get help/ this view
```## Examples
Get info with autologin of all AP's
```bash
./unifi-bulk.sh --get-apinfo 1
```Set EDNS without autologin of all AP's
```bash
./unifi-bulk.sh --set-hosts 0
```Run own commands with autologin of all AP's
```bash
./unifi-bulk.sh --run-cmd 1 'pwd && iptables -L; cat /tmp/system.cfg; info; echo "Using a String with echo"; sleep 1'
```Run own hardcoded command (in head of script file) without autologin of all AP's
```bash
./unifi-bulk.sh --run-cmd 0 -
```## All rights reserved 2023 (c) suuhm
## Let me know if you find some bugs and feature wishes and post an issue!