Created
February 8, 2024 20:47
-
-
Save joncutrer/330de3648ed7e5db1d295a80600b246a to your computer and use it in GitHub Desktop.
Windows Batch Script to reboot UniFi APs via SSH (using plink.exe)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM ssh-reboot.bat | |
REM This script requires a copy of plink.exe from Putty placed in the same folder as the script or somewhere in the path. | |
set aplist=192.168.1.12,192.168.1.13,192.168.1.14 | |
set user=<yoursshusername> | |
set pw=<yoursshpassword> | |
set cmd=reboot | |
set targetip=%1 | |
echo %targetip% | |
(for %%a in (%aplist%) do ( | |
echo Rebooting AP: %%a | |
echo y | plink %user%@%%a -ssh -pw %pw% %cmd% | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment