diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2014-04-11 14:28:53 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2014-04-11 14:32:21 -0300 |
commit | 76b27c643a778bd2f7e63c4ee3d3b105b7813328 (patch) | |
tree | 9aee31c7ca9a0d9e84bde5cb83370ed586d533bb /libre/cacert-dot-org/cacert-dot-org.install | |
parent | 9a7056bf7bbd21f46640e8b171820d021dc32a8e (diff) | |
download | abslibre-76b27c643a778bd2f7e63c4ee3d3b105b7813328.tar.gz abslibre-76b27c643a778bd2f7e63c4ee3d3b105b7813328.tar.bz2 abslibre-76b27c643a778bd2f7e63c4ee3d3b105b7813328.zip |
cacert-dot-org: add new package on [libre] to solve malfunctioning updates because our certificates are issued by cacert => https://lists.parabolagnulinux.org/pipermail/dev/2014-April/002158.html
Diffstat (limited to 'libre/cacert-dot-org/cacert-dot-org.install')
-rw-r--r-- | libre/cacert-dot-org/cacert-dot-org.install | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libre/cacert-dot-org/cacert-dot-org.install b/libre/cacert-dot-org/cacert-dot-org.install new file mode 100644 index 000000000..eb11f6607 --- /dev/null +++ b/libre/cacert-dot-org/cacert-dot-org.install @@ -0,0 +1,26 @@ +post_install() { + #UPDATE FILE NAMES IN ca-certificates.conf IF THEY'RE OUT OF DATE + [[ `grep -c "mozilla/cacert.org" /etc/ca-certificates.conf` -gt 0 ]] && sed -i 's/mozilla\/cacert\.org/cacert\.org\/cacert\.org/g' /etc/ca-certificates.conf + [[ `grep -c "cacert.org/cacert.org-" /etc/ca-certificates.conf` -gt 0 ]] && sed -i 's/cacert\.org\/cacert\.org-/cacert\.org\/cacert\.org_/g' /etc/ca-certificates.conf + + #ADD THE CERTIFICATES TO ca-certificates.conf IF THEY'RE MISSING + [[ `grep -c "cacert.org/cacert.org_root.crt" /etc/ca-certificates.conf` -eq 0 ]] && echo "cacert.org/cacert.org_root.crt" >> /etc/ca-certificates.conf + [[ `grep -c "cacert.org/cacert.org_class3.crt" /etc/ca-certificates.conf` -eq 0 ]] && echo "cacert.org/cacert.org_class3.crt" >> /etc/ca-certificates.conf + + #UPDATE THE CERTIFICATES BASED ON ca-certificates.conf + update-ca-certificates --fresh +} + +post_upgrade() { + post_install +} + +post_remove() { + grep -v "cacert.org" /etc/ca-certificates.conf > /dev/shm/ca-certificates.conf.tmp + if [[ -s /dev/shm/ca-certificates.conf.tmp ]]; then + mv /dev/shm/ca-certificates.conf.tmp /etc/ca-certificates.conf + update-ca-certificates --fresh + else + echo "An error occurred that prevented the cacert.org certificates from being removed from /etc/ca-certificates.conf, please remove them manually, then run update-ca-certificates --fresh" + fi +} |