Richard G
Verified User
@Erulezz I'm using this script to see which sites have letsencrypt active, when activated and when it would expire:
I've seen small changes on your github script, which I tried on 1 server but the issue remains.
It seems nowadays the *.san_config can't be found anymore in the users domains dir.
There is a .key and a .cert present.
Now the problem is, I just renewed a domain which succeeded, but the script won't see it.
It seems that it only sees 3 domains which was renews before february 17th.
But there are multiple domains who are working and who do have newer renewal dates. So probably something in LE is changed causing this script looking at the wrong way or wrong place?
Can I fix this soon or do you rather have me reporting this on your github site?
Code:
#!/bin/bash
ledomains=0
for san in `ls -1 /usr/local/directadmin/data/users/*/domains/*.san_config`;
do
domain=`basename ${san}`;
dirname=`dirname ${san}`;
domain=${domain%.san_config};
if [ -e "${dirname}/${domain}.cert.creation_time" ] && [ -e "${dirname}/${domain}.cert" ] && [ -e "${dirname}/${domain}.key" ];
then
ledomains=$[ledomains + 1];
sanconfig=`cat ${dirname}/${domain}.san_config | grep "subjectAltName"`;
created=`cat ${dirname}/${domain}.cert.creation_time`;
created_date=`LC_ALL=en_US.utf8 date -d @$created`;
renewal_date=`LC_ALL=en_US.utf8 date -d "$created_date+60 days"`;
renewal_days=$(expr '(' $created + 5184000 - $(LC_ALL=en_US.utf8 date +%s) ')' / 86400)
echo "Lets Encrypt domain: $domain";
echo "$sanconfig";
echo "-- Created: $created_date - $created";
echo "-- Renewal: $renewal_date";
echo "-- Renewal in $renewal_days days.";
echo "";
fi;
done;
echo "";
echo "Lets Encrypt domains: $ledomains";
echo "";
if [ -e "/usr/local/directadmin/conf/cacert.pem.creation_time" ];
then
sanconfig=`cat /usr/local/directadmin/conf/ca.san_config | grep "subjectAltName"`;
created=`cat /usr/local/directadmin/conf/cacert.pem.creation_time`;
created_date=`LC_ALL=en_US.utf8 date -d @$created`;
renewal_date=`LC_ALL=en_US.utf8 date -d "$created_date+60 days"`;
renewal_days=$(expr '(' $created + 5184000 - $(LC_ALL=en_US.utf8 date +%s) ')' / 86400)
echo "Lets Encrypt Hostname";
echo "$sanconfig";
echo "-- Created: $created_date - $created";
echo "-- Renewal: $renewal_date";
echo "-- Renewal in $renewal_days days.";
echo "";
fi;
exit 0;
I've seen small changes on your github script, which I tried on 1 server but the issue remains.
It seems nowadays the *.san_config can't be found anymore in the users domains dir.
There is a .key and a .cert present.
Now the problem is, I just renewed a domain which succeeded, but the script won't see it.
It seems that it only sees 3 domains which was renews before february 17th.
But there are multiple domains who are working and who do have newer renewal dates. So probably something in LE is changed causing this script looking at the wrong way or wrong place?
Can I fix this soon or do you rather have me reporting this on your github site?