apache_autoconf honore le fichier sites.conf

This commit is contained in:
Jephté Clain 2014-03-21 12:45:17 +04:00
parent c3b66b5c5c
commit 15c562217f
2 changed files with 22 additions and 6 deletions

View File

@ -1 +1 @@
27
28

View File

@ -634,10 +634,26 @@ s#@@ca@@#$APACHESSLCERTSDIR/$(basename "$ca")#g
done
fi
if [ -f "$confdir/sites.conf" ]; then
#enablesites=()
#disablesites=()
# refaire enablesites et disablesites
: #XXX activer les sites
local -a sitesconfs; local sitesconf
array_from_lines sitesconfs "$(<"$confdir/sites.conf" filter_conf)"
if [ ${#sitesconfs[*]} -gt 0 ]; then
# si une configuration existe, ignorer la configuration
# automatique
enablesites=()
disablesites=()
for sitesconf in "${sitesconfs[@]}"; do
if [ "${sitesconf#+}" != "$sitesconf" ]; then
array_del disablesites "${sitesconf#+}"
array_add enablesites "${sitesconf#+}"
elif [ "${sitesconf#-}" != "$sitesconf" ]; then
array_del enablesites "${sitesconf#-}"
array_add disablesites "${sitesconf#-}"
else
array_del disablesites "$sitesconf"
array_add enablesites "$sitesconf"
fi
done
fi
fi
eend
fi
@ -653,7 +669,7 @@ s#@@ca@@#$APACHESSLCERTSDIR/$(basename "$ca")#g
fi
if [ -n "${enablesites[*]}" -o -n "${disablesites[*]}" ]; then
etitle "Activation des sites"
etitle "(dés)Activation des sites"
local site
for site in "${enablesites[@]}"; do
a2ensite "$site"