openvpn: shellpki upstream release 22.12.1
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
This commit is contained in:
parent
fafff25c20
commit
5e63340aa9
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
VERSION="22.12"
|
VERSION="22.12.1"
|
||||||
|
|
||||||
show_version() {
|
show_version() {
|
||||||
cat <<END
|
cat <<END
|
||||||
|
@ -23,6 +23,16 @@ Usage: ${0} [--version]
|
||||||
END
|
END
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_carp_state() {
|
||||||
|
if [ "${SYSTEM}" = "openbsd" ]; then
|
||||||
|
carp=$(/sbin/ifconfig carp0 2>/dev/null | grep 'status' | cut -d' ' -f2)
|
||||||
|
|
||||||
|
if [ "$carp" = "backup" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_ca_expiration() {
|
check_ca_expiration() {
|
||||||
echo "CA certificate:"
|
echo "CA certificate:"
|
||||||
openssl x509 -enddate -noout -in ${cacert_path} \
|
openssl x509 -enddate -noout -in ${cacert_path} \
|
||||||
|
@ -79,17 +89,8 @@ check_certs_expiration() {
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
SYSTEM=$(uname | tr '[:upper:]' '[:lower:]')
|
SYSTEM=$(uname | tr '[:upper:]' '[:lower:]')
|
||||||
|
cacert_path="/etc/shellpki/cacert.pem"
|
||||||
if [ "${SYSTEM}" = "openbsd" ]; then
|
index_path="/etc/shellpki/index.txt"
|
||||||
carp=$(/sbin/ifconfig carp0 2>/dev/null | grep 'status' | cut -d' ' -f2)
|
|
||||||
|
|
||||||
if [ "$carp" = "backup" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
cacert_path="/etc/openvpn/ssl/ca/cacert.pem"
|
|
||||||
index_path="/etc/openvpn/ssl/ca/index.txt"
|
|
||||||
somedays="3456000" # 40 days currently
|
somedays="3456000" # 40 days currently
|
||||||
expired_certs=""
|
expired_certs=""
|
||||||
expiring_soon_certs=""
|
expiring_soon_certs=""
|
||||||
|
@ -107,6 +108,7 @@ main() {
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"")
|
"")
|
||||||
|
check_carp_state
|
||||||
echo "Warning : all times are in UTC !"
|
echo "Warning : all times are in UTC !"
|
||||||
echo ""
|
echo ""
|
||||||
check_ca_expiration
|
check_ca_expiration
|
||||||
|
|
Loading…
Reference in a new issue