diff options
author | Erich Eckner <git@eckner.net> | 2024-03-07 18:03:41 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2024-03-07 18:03:41 +0100 |
commit | 987de7bea192fdc2a351aa69c04ff544eb50cc6f (patch) | |
tree | 858fe00f00034fd3293fc141679e5037dcb8a0f2 /local-certificates | |
parent | c4e4134896cca0bb854bbcf695acfe357571f299 (diff) | |
download | archlinuxewe-987de7bea192fdc2a351aa69c04ff544eb50cc6f.tar.xz |
local-certificates: add all certificates, that are not yet expired since a week
Diffstat (limited to 'local-certificates')
-rw-r--r-- | local-certificates/PKGBUILD | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/local-certificates/PKGBUILD b/local-certificates/PKGBUILD index 99d1fef2d..fec55f1eb 100644 --- a/local-certificates/PKGBUILD +++ b/local-certificates/PKGBUILD @@ -3,7 +3,7 @@ pkgname='local-certificates' arch=('any') pkgver=2024.03.07.05.12.53 -pkgrel=2 +pkgrel=3 pkgdesc='Certificate for local version of https://arch.eckner.net' license=('GPL') install='local-certificates.install' @@ -43,8 +43,17 @@ package() { install -d "${pkgdir}/usr/share/ca-certificates/trust-source/anchors" for s in *{,.old}.cert.pem *{,.old}.crt; do [ -f "$s" ] || continue - install \ - "${s}" \ - "${pkgdir}/usr/share/ca-certificates/trust-source/anchors/${s#????-??-??T??:??:??.}" + if [ $(date -d"$(openssl x509 -noout -enddate -in "$s" | cut -d= -f2)" +%s) -lt $(($(date +%s)-24*60*60*7)) ]; then + continue + fi + t="${pkgdir}/usr/share/ca-certificates/trust-source/anchors/${s#????-??-??T??:??:??.}" + if [ -f "${t}" ]; then + t="${t%.crt}.2.crt" + fi + while [ -f "${t}" ]; do + t="${t%.crt}" + t="${t%.*}.$((${t##*.}+1)).crt" + done + install "${s}" "${t}" done } |