Skip to content
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

Fix syntax for OpenBSD sh #6099

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Fix syntax for OpenBSD sh #6099

wants to merge 1 commit into from

Conversation

catap
Copy link

@catap catap commented Nov 15, 2024

No description provided.

Copy link

Welcome
First thing: don't send PR to the master branch, please send to the dev branch instead.
Please make sure you've read our DNS API Dev Guide and DNS-API-Test.
Then reply on this message, otherwise, your code will not be reviewed or merged.
We look forward to reviewing your Pull request shortly ✨
注意: 必须通过了 DNS-API-Test 才会被 review. 无论是修改, 还是新加的 dns api, 都必须确保通过这个测试.

Copy link

Welcome
Please make sure you've read our Code-of-conduct and add the usage here: notify.
Then reply on this message, otherwise, your code will not be reviewed or merged.
We look forward to reviewing your Pull request shortly ✨

@catap
Copy link
Author

catap commented Nov 15, 2024

Welcome First thing: don't send PR to the master branch, please send to the dev branch instead. Please make sure you've read our DNS API Dev Guide and DNS-API-Test. Then reply on this message, otherwise, your code will not be reviewed or merged. We look forward to reviewing your Pull request shortly ✨ 注意: 必须通过了 DNS-API-Test 才会被 review. 无论是修改, 还是新加的 dns api, 都必须确保通过这个测试.

done

@catap
Copy link
Author

catap commented Nov 15, 2024

Welcome Please make sure you've read our Code-of-conduct and add the usage here: notify. Then reply on this message, otherwise, your code will not be reviewed or merged. We look forward to reviewing your Pull request shortly ✨

done

@catap
Copy link
Author

catap commented Nov 16, 2024

@Neilpang I haven't got an account at netcup nor AWS SES. Is it an issue?

@Neilpang
Copy link
Member

yes, if you don't have an account of AWS SES, why do you need to fix it? how can you make sure it's necessary?

@catap
Copy link
Author

catap commented Nov 17, 2024

@Neilpang I made a port for OpenBSD and it was discovered what OpenBSD sh complains on syntax of this files:

find /build/pobj/acme.sh-3.0.9/acme.sh-3.0.9 -type f -name \*.sh -exec sh -n {} \;
/build/pobj/acme.sh-3.0.9/acme.sh-3.0.9/dnsapi/dns_netcup.sh[128]: syntax error: `(' unexpected
/build/pobj/acme.sh-3.0.9/acme.sh-3.0.9/notify/aws_ses.sh[227]: no closing quote

So, I had adjusted syntax a bit which passes that tests.

@catap
Copy link
Author

catap commented Nov 17, 2024

Regardig that it's safe:

  1. I've replaced all login into _login at dnsapi/dns_netcup.sh:
acme.sh $ grep login dnsapi/dns_netcup.sh                                                                                                 
  _login
  _login
_login() {
  tmp=$(_post "{\"action\": \"login\", \"param\": {\"apikey\": \"$NC_Apikey\", \"apipassword\": \"$NC_Apipw\", \"customernumber\": \"$NC_CID\"}}" "$end" "" "POST")
acme.sh $ 
  1. tr -d '"' and tr -d \" works the same way, and at the end I've used bash because it doesn't work on ksh:
acme.sh $ echo 'as " bs " qs' | tr -d '"' 
as  bs  qs
acme.sh $ echo 'as " bs " qs' | tr -d \"  
as  bs  qs
acme.sh $ echo $(echo 'as " bs " qs' | tr -d \")
as bs qs
acme.sh $ echo "$(echo 'as " bs " qs' | tr -d \")"
as  bs  qs
acme.sh $ bash
bash-5.2$ echo "$(echo 'as " bs " qs' | tr -d \")"
as  bs  qs
bash-5.2$ echo "$(echo 'as " bs " qs' | tr -d '"')"
as  bs  qs
bash-5.2$ echo "$(echo "$(echo 'as " bs " qs' | tr -d '"')")"
as  bs  qs
bash-5.2$ echo "$(echo "$(echo 'as " bs " qs' | tr -d \")")"
as  bs  qs
bash-5.2$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants