Syntax Error
Closed this issue · 14 comments
I got log "./uap_reboot.sh: 20: ./uap_reboot.sh: Syntax error: "(" unexpected"
I just copy all your script and just change the IP address in the ( ) and I got error "./uap_reboot.sh: 20: ./uap_reboot.sh: Syntax error: "(" unexpected".
I using Ubuntu 16.04.3
Thanks
Faiz
Hi Steve,
I already try without quote but the same message occur "./uap_reboot.sh: Syntax error: "(" unexpected"
Thanks,
Faiz
Very helpful screen caps. Thanks!
Will you please try changing the first line from #!/bin/sh
to #!/bin/bash
and tell me what happens?
Are you able to SSH to those IP addresses manually using the same credentials you put in the script? And BTW, if that's your UniFi password shown in the screencap, you should probably change it. :)
Please try:
sshpass -p PASSWORD ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null USERNAME@IPADDRESS reboot
with your own PASSWORD, USERNAME, and IPADDRESS of a UAP, then let me know what happens.
Hi Steve,
I get the same message
"Warning: Permanently added '172.16.3.102' (RSA) to the list of known hosts.
Permission denied, please try again."
Thanks
Faiz
Ok, so either sshpass or the ssh client are generating that error.
Please try one of the two approaches in the answer here and see if that fixes: