ansible-roles/evolinux-base/files/cert.sh
William Hirigoyen 1f8738fbda
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2696|33|2663|34|:+1: Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/467//ansiblelint">Evolix » ansible-roles » unstable #467</a>
gitea/ansible-roles/pipeline/head This commit looks good
postfix: move postfix installation from evolinux-base to postfix role, plus some refactoring
postfix:
* Move common packages installation in common.yml
* Replace ansible_fqdn by evolinux_fqdn, set postfix_slow_transport_include to false by default (only for packmails and packwebs)
* Remove dependency on evolinux_fqdn var
* Do not overwrite main.cf if it has been modified (except if postfix_force_main_cf)

evolinux-base:
* Move exim4 purge from evolinux-base to postfix role
* Call postfix role call after nagios role (dependency)
2024-02-01 18:00:48 +01:00

38 lines
811 B
Bash

#!/bin/bash
#
# Shortcut to show certificate content or enddate.
#
usage() {
echo "Usage : cert [date] <CERT_PATH>"
}
if [ "$#" -eq 1 ]; then
cert_path=$1
if [ -f "${cert_path}" ]; then
openssl x509 -noout -in "${cert_path}" -text
else
>&2 echo "Error, file ${cert_path} does not exist."
fi
elif [ "$#" -eq 2 ]; then
if [ "$1" = "date" ]; then
cert_path=$2
if [ -f "${cert_path}" ]; then
openssl x509 -noout -in "$cert_path" -enddate
else
>&2 echo "Error, file ${cert_path} does not exist."
fi
else
>&2 echo "Error, two arguments provided but 'date' is only allowed as first."
usage
exit 1
fi
else
>&2 echo "Error, more than two arguments provided."
usage
exit 1
fi