Skip to content

Commit

Permalink
improve certbot-cleaner.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoey2936 committed Mar 21, 2024
1 parent d724439 commit a07cd8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 91 deletions.
90 changes: 0 additions & 90 deletions rootfs/usr/local/bin/certbot-cleaner.sh

This file was deleted.

15 changes: 14 additions & 1 deletion rootfs/usr/local/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,20 @@ if [ "$CLEAN" = "true" ]; then
/data/logs \
/data/error.log \
/data/nginx/error.log
certbot-cleaner.sh
rm -vf /data/tls/certbot/crs/*.pem
rm -vf /data/tls/certbot/keys/*.pem

certs_in_use="$(find /data/tls/certbot/live -type l -exec readlink -f {} \;)"
export certs_in_use
# from: https://www.shellcheck.net/wiki/SC2044
find /data/tls/certbot/archive ! -name "$(printf "*\n*")" -type f > tmp
while IFS= read -r archive
do
if ! echo "$certs_in_use" | grep -q "$archive"; then
echo "$archive"
fi
done < tmp
rm tmp
fi

if [ -s "$DB_SQLITE_FILE" ]; then
Expand Down

0 comments on commit a07cd8c

Please sign in to comment.