Closed rea0056 closed 6 years ago
Hi, @rea0056. Is this the same issue as #15? If so, the latest version of the script (without quotes in the UAP list) will fix it on Ubuntu and I can close this issue. Thanks!
Hi Steve,
I already try without quote but the same message occur _"./uapreboot.sh: Syntax error: "(" unexpected"
Thanks, Faiz
You can refer this picture.
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?
On Wed, Mar 28, 2018 at 10:46 PM Steve Jenkins notifications@github.com wrote:
Very helpful screen caps. Thanks!
Will you please try changing the first line from #!/bin/sh to #!/bin/bash and tell me what happens?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stevejenkins/unifi-linux-utils/issues/20#issuecomment-377112272, or mute the thread https://github.com/notifications/unsubscribe-auth/AAV_l3wVh-CMsPzJULry9xS8Go9oFoaVks5tjFkmgaJpZM4S-h5U .
For verbosity, you could append an -x, so it looks like:
Hi Steve,
Now the script can be execute by changing #!/bin/sh to #!/bin/bash . But now there was other issue occur.
Why permission denied? Is there something I missing?
Thanks, Faiz
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. :)
@rea0056, @rjt makes an excellent suggestion. Please temporarily add -x to the first line: #!/bin/bash -x
to run Bash in debug mode.
Hi Steve,
I able to SSH into the AP manually, but the script can't. Anything that I missing?
Thanks Faiz
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:
Have not run this script recently and do not have Ubuntu 16 running
anyway. Wonder if the permission model of his access points are different
in respect to the reboot command. Wonder if he gets the same error when
attempting the reboot command manually? Does that user need to actually
run sudo reboot
?
Adding -vv to the ssh command line might give some clues as well.
Lastly, when i issue remote ssh commands, i wrap the “command” in quotes, so in this case “reboot”.
On Wed, Mar 28, 2018 at 11:31 PM Steve Jenkins notifications@github.com wrote:
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:
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/stevejenkins/unifi-linux-utils/issues/20#issuecomment-377118181, or mute the thread https://github.com/notifications/unsubscribe-auth/AAV_l-7w_CWigjouJNqcnQ8rAaOnarv8ks5tjGOIgaJpZM4S-h5U .
Also put your ‘password in single quotes’ or put in a file as mentioned in the article:
It looks the message Permission denied, please try again. is generated by the SSH client. The password should be quoted to escape the special meaning of characters as $, !, etc. (ref https://askubuntu.com/revisions/982438/4 ):
sshpass -p 'footbar' ...
Or you can use a file where the password to be stored (source https://askubuntu.com/a/982438/566421):
sshpass -f "/path/to/passwordfile" ...
On Thu, Mar 29, 2018 at 10:29 AM Rob Townley rob.townley@gmail.com wrote:
Have not run this script recently and do not have Ubuntu 16 running anyway. Wonder if the permission model of his access points are different in respect to the reboot command. Wonder if he gets the same error when attempting the reboot command manually? Does that user need to actually run
sudo reboot
?Adding -vv to the ssh command line might give some clues as well.
Lastly, when i issue remote ssh commands, i wrap the “command” in quotes, so in this case “reboot”.
On Wed, Mar 28, 2018 at 11:31 PM Steve Jenkins notifications@github.com wrote:
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:
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/stevejenkins/unifi-linux-utils/issues/20#issuecomment-377118181, or mute the thread https://github.com/notifications/unsubscribe-auth/AAV_l-7w_CWigjouJNqcnQ8rAaOnarv8ks5tjGOIgaJpZM4S-h5U .
I got log _"./uap_reboot.sh: 20: ./uapreboot.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: ./uapreboot.sh: Syntax error: "(" unexpected".
I using Ubuntu 16.04.3
Thanks Faiz