Remote Reboot Ubnt

    800

    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—

    then put this script under crontab !