Ubiquiti

Remote Reboot UBNT

16 views June 9, 2017 June 9, 2017 admin 0

To remote reboot a UBNT device you require a Linux, Unix or a Mac OS to run the script.

Step 1 : Install expect

#yum install expect

Step 2 : Edit this file

*Host and replace with your IP of UBNT AP

(User : username , PASS with your password of AP)

———start-here———
#!/bin/bash
HOST=”172.16.1.22″
USER=”ubnt”
PASS=”ubnt”
CMD=reboot

VAR=$(expect -c ”
spawn ssh -o StrictHostKeyChecking=no $USER@$HOST $CMD
match_max 100000
expect \”*?assword:*\”
send — \”$PASS\r\”
send — \”\r\”
expect eof
“)
echo “===============”
echo “$VAR”
———end-here———

Step 3 : Put this script under crontab

Was this helpful?