Run renewal script error

Hi,
I run the renewal script error,
error message as below,
can help me see what is the problem?

user@example:/opt/letsencrypt$ sudo le-renew-webroot
/usr/local/sbin/le-renew-webroot: line 23: bc: command not found
Checking expiration date for example.com...
/usr/local/sbin/le-renew-webroot: line 27: [: : integer expression expected
The certificate for example.com is about to expire soon. Starting webroot renewal script...
Checking for new version...
Requesting root privileges to run letsencrypt...
   /root/.local/share/letsencrypt/bin/letsencrypt certonly -a webroot --agree-tos --renew-by-default --config /usr/local/etc/le-renew-webroot.ini

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at
   /etc/letsencrypt/live/example.com/fullchain.pem. Your cert will
   expire on 2016-07-14. To obtain a new version of the certificate in
   the future, simply run Let's Encrypt again.
 - If you like Let's Encrypt, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

Reloading nginx
Renewal process finished for domain example.com

My server environment:
OS: Debian 8
Web Server Version: Nginx 1.9.14

Thank you

Install bc?

sudo apt-get install bc

Surprised it kept going, It'd be better to after that kind of error message..

problem solved,
Thank for help.

Hello @jie,

@Caucvi already told you how to solve the issue installing bc program... but just for the records, I suppose you are using le-renew-webroot script.

The script is using bc program to calculate how many days left until the certificate expires:

days_exp=$(echo \( $exp - $datenow \) / 86400 |bc)

But there is no need to use the external program bc to perform this calculation, you can use built-in shell arithmetic functions to avoid install bc program so you can simply replace above line with this one:

days_exp=$(( ($exp-$datenow)/86400 ))

Cheers,
sahsanu

Thanks a lot!
it was really helpful

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.