-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax Error #20
Comments
Hi Steve, I already try without quote but the same message occur "./uap_reboot.sh: Syntax error: "(" unexpected" Thanks, |
Very helpful screen caps. Thanks! Will you please try changing the first line from |
On Wed, Mar 28, 2018 at 10:46 PM Steve Jenkins ***@***.***> 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
<#20 (comment)>,
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:
#!/bin/bash -x
|
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:
with your own PASSWORD, USERNAME, and IPADDRESS of a UAP, then let me know what happens. |
Hi Steve, I get the same message Thanks |
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 ***@***.***> 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:
https://askubuntu.com/questions/986179/permission-denied-when-trying-to-run-a-script-that-uses-sshpass
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
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 ***@***.***> 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 ***@***.***>
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:
>
>
> https://askubuntu.com/questions/986179/permission-denied-when-trying-to-run-a-script-that-uses-sshpass
>
> —
> You are receiving this because you were mentioned.
>
>
> Reply to this email directly, view it on GitHub
> <#20 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAV_l-7w_CWigjouJNqcnQ8rAaOnarv8ks5tjGOIgaJpZM4S-h5U>
> .
>
|
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
The text was updated successfully, but these errors were encountered: