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

"renew" exit code #850

Closed
joseftsch opened this issue May 16, 2017 · 3 comments
Closed

"renew" exit code #850

joseftsch opened this issue May 16, 2017 · 3 comments

Comments

@joseftsch
Copy link

joseftsch commented May 16, 2017

Hey,

Running the command with "--renew" option (and renewal is skipped) it returns with exit code 2.
IMHO that should be exit code 0 because it is not an error in any way.

[root@host ~]# /opt/acme_sh/acme.sh --version
https://github.com/Neilpang/acme.sh
v2.6.9
[root@host ~]# /opt/acme_sh/acme.sh --renew -d asdf.test.name --ecc --certhome /opt/acme_sh/workingdir
[Tue May 16 19:32:28 CEST 2017] Renew: 'asdf.test.name'
[Tue May 16 19:32:28 CEST 2017] Skip, Next renewal time is: Fri Jul 14 20:24:32 UTC 2017
[Tue May 16 19:32:28 CEST 2017] Add '--force' to force to renew.
[root@host ~]# echo $?
2
[root@host ~]#

@Neilpang
Copy link
Member

Sorry, that's designed.
Please check the return code by yourself.
Thanks.

@Profex
Copy link

Profex commented Dec 29, 2019

Should the current acme.sh version still return 2 when certificate renewal is skipped?
Unfortunately it's not the case for me, and I need to know within my acme.sh wrapper script:

/usr/local/share/acme.sh/acme.sh --cron --home /usr/local/share/acme.sh/

[Sun Dec 29 17:39:23 CET 2019] ===Starting cron===
[Sun Dec 29 17:39:23 CET 2019] Installing from online archive.
[Sun Dec 29 17:39:23 CET 2019] Downloading https://github.com/Neilpang/acme.sh/archive/master.tar.gz
[Sun Dec 29 17:39:24 CET 2019] Extracting master.tar.gz
[Sun Dec 29 17:39:24 CET 2019] Installing to /usr/local/share/acme.sh/
[Sun Dec 29 17:39:24 CET 2019] Installed to /usr/local/share/acme.sh//acme.sh
[Sun Dec 29 17:39:24 CET 2019] Good, bash is found, so change the shebang to use bash as preferred.
[Sun Dec 29 17:39:26 CET 2019] OK
[Sun Dec 29 17:39:26 CET 2019] Install success!
[Sun Dec 29 17:39:26 CET 2019] Upgrade success!
[Sun Dec 29 17:39:26 CET 2019] Auto upgraded to: 2.8.4
[Sun Dec 29 17:39:26 CET 2019] Renew: '*.xxxxxxxx'
[Sun Dec 29 17:39:26 CET 2019] Skip, Next renewal time is: Tue Jan 28 01:00:40 UTC 2020
[Sun Dec 29 17:39:26 CET 2019] Add '--force' to force to renew.
[Sun Dec 29 17:39:26 CET 2019] Skipped *.xxxxxxxx
root@DiskStation:~# echo $?
0

@andrzejpolis
Copy link

I understand this choice - if you want to know just if cert was renewed than 0 this situation only and 2 for all other scenarios. However it is a clear as well that in other scenarios you would like to treat return value as - is my daily executed process of checking cert validity working fine. And for this such return value is very inconvenient.
Would it be acceptable to make this a configurable option? Or if my assumptions are wrong and you have completely different reasoning could you at least describe them?
Thank you.

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

No branches or pull requests

4 participants