apache_autoconf(): déploiement des certificats autorité
This commit is contained in:
parent
775a02119e
commit
16d95d2a73
|
@ -259,15 +259,6 @@ function apache_autoconf() {
|
|||
[ -n "$wwwdir" ] || wwwdir="$autoconfdir/www"
|
||||
[ -n "$certsconfdir" ] || certsconfdir="$autoconfdir/certsconf"
|
||||
[ -n "$rrdir" ] || rrdir="$autoconfdir/RewriteRules"
|
||||
if [ -d "$certsconfdir" ]; then
|
||||
if [ -z "$certsdir" ]; then
|
||||
eerror "CERTSDIR est requis si --certsconfdir est spécifié"
|
||||
return 1
|
||||
elif [ ! -d "$certsdir" ]; then
|
||||
eerror "$certsdir: répertoire invalide"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Faire un script sed pour remplacer les variables spécifiées par leur
|
||||
# valeur dans les fichiers
|
||||
|
@ -284,10 +275,10 @@ function apache_autoconf() {
|
|||
ac_set_tmpfile FILLTEMP
|
||||
|
||||
# Copie des certificats
|
||||
local modified conf
|
||||
local modified rehash conf
|
||||
if [ -d "$certsconfdir" ]; then
|
||||
local -a certsconfs
|
||||
local certsconf cert key ca
|
||||
local -a certsconfs certspems
|
||||
local certsconf certspem cert key ca
|
||||
array_addu FILLVARS cert
|
||||
array_addu FILLVARS key
|
||||
array_addu FILLVARS ca
|
||||
|
@ -295,10 +286,24 @@ function apache_autoconf() {
|
|||
etitle "Installation des certificats"
|
||||
array_lsfiles certsconfs "$certsconfdir" "*.conf"
|
||||
for certsconf in "${certsconfs[@]}"; do
|
||||
if [ -z "$certsdir" ]; then
|
||||
eerror "CERTSDIR est requis si --certsconfdir est spécifié"
|
||||
return 1
|
||||
elif [ ! -d "$certsdir" ]; then
|
||||
eerror "$certsdir: répertoire invalide"
|
||||
return 1
|
||||
fi
|
||||
apache_resolvecert "$certsconf" "$certsdir" cert key ca || return 1
|
||||
apache_addcert -y "$cert" "$key" "$ca"
|
||||
modified=1
|
||||
done
|
||||
array_lsfiles certspems "$certsconfdir" "*.crt" "*.pem"
|
||||
for certspem in "${certspems[@]}"; do
|
||||
if copy_update "$certspem" "$APACHESSLCERTSDIR/$(basename -- "$certspem")"; then
|
||||
modified=1
|
||||
rehash=1
|
||||
fi
|
||||
done
|
||||
eend
|
||||
fi
|
||||
|
||||
|
@ -499,8 +504,11 @@ s#@@ca@@#$APACHESSLCERTSDIR/$(basename "$ca")#g
|
|||
eend
|
||||
fi
|
||||
|
||||
if [ -n "$modified" -a -n "$restart" ]; then
|
||||
estep "Redémarrage d'apache"
|
||||
"$APACHECTL" restart
|
||||
if [ -n "$modified" ]; then
|
||||
[ -n "$rehash" ] && elinedots "Hashage des certificats" c_rehash
|
||||
if [ -n "$restart" ]; then
|
||||
estep "Redémarrage d'apache"
|
||||
"$APACHECTL" restart
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue