PREIN
/bin/sh
#Check config file sanity
if [ -e /usr/sbin/ap13chkconfig ]; then /usr/sbin/ap13chkconfig;fi
POSTIN
/bin/sh
if [ $1 = "1" ]; then
#We're in Install mode, add module to the config files
for config in /etc/httpd/conf/{httpd,httpd-perl}.conf; do
if [ -x /usr/sbin/advxaddmod -a -e $config ]; then
/usr/sbin/advxaddmod $config \
extramodules/libssl.so mod_ssl.c ssl_module \
define=HAVE_SSL addconf=conf/ssl/mod_ssl.conf
fi
echo "Include conf/ssl/ssl.default-vhost.conf" >> $config
done
#Create a self-signed server key and certificate
#this will overwrite the dummy certificate
echo "Generating self-signed certificate"
pushd /etc/ssl/apache/ >/dev/null
yes ""|/usr/lib/ssl/mod_ssl/gentestcrt.sh >/dev/null 2>/dev/null
popd > /dev/null
if [ -e /usr/sbin/ADVXctl ]; then /usr/sbin/ADVXctl update;fi
fi
alias FIXME="perl -pi -e"
if [ $1 -gt 1 ]; then
#We're in *upgrade mode*. Since we can't be sure the configuration files
#are sane, remove module from the conf files to clean them, re-add again
#in a way that the older module we're replacing won't try to erase (the
#post scripts were broken on some packages), and finally clean the module
#specific config file so it's compatible with the upgrade.
for config in /etc/httpd/conf/{httpd,httpd-perl}.conf; do
if [ -x /usr/sbin/advxdelmod -a -e $config ]; then
/usr/sbin/advxdelmod $config \
extramodules/libssl.so mod_ssl.c ssl_module \
define=HAVE_SSL addconf=conf/ssl/mod_ssl.conf
FIXME 's|^#*Include\s+conf/ssl/ssl.default-vhost.conf\n||g;' \
$config
fi
if [ -x /usr/sbin/advxaddmod -a -e $config ]; then
/usr/sbin/advxaddmod $config \
extramodules/libssl.so mod_ssl.c ssl_module \
define=HAVE_SSL addconf=conf/ssl/mod_ssl.conf
echo "Include conf/ssl/ssl.default-vhost.conf" >> $config
fi
done
if [ -x /usr/sbin/advxfixconf ]; then
/usr/sbin/advxfixconf \
/etc/httpd/conf/ssl/mod_ssl.conf \
libssl.so mod_ssl.c ssl_module ifmodule
/usr/sbin/advxfixconf \
/etc/httpd/conf/ssl/ssl.default-vhost.conf \
libssl.so mod_ssl.c ssl_module ifmodule
fi
FIXME 's|file:logs/ssl_mutex|sem|g;' \
/etc/httpd/conf/ssl/mod_ssl.conf
#Create a self-signed server key and certificate
#this will overwrite the dummy certificate, but will
#not overwrite a user-generated certificate, since we
#use config noreplace and it checks the mdsum
echo "Generating self-signed certificate"
pushd /etc/ssl/apache/ > /dev/null
yes ""|/usr/lib/ssl/mod_ssl/gentestcrt.sh >/dev/null 2>/dev/null
popd > /dev/null
if [ ! -e /usr/lib/apache/libssl.so ]; then
if [ -e /usr/sbin/ADVXctl ]; then /usr/sbin/ADVXctl update;fi
fi
fi
POSTUN
/bin/sh
alias FIXME="perl -pi -e"
if [ $1 = "0" ]; then
for config in /etc/httpd/conf/{httpd,httpd-perl}.conf; do
if [ -x /usr/sbin/advxdelmod -a -e $config ]; then
/usr/sbin/advxdelmod $config \
extramodules/libssl.so mod_ssl.c ssl_module \
define=HAVE_SSL addconf=conf/ssl/mod_ssl.conf
FIXME 's|^#*Include\s+conf/ssl/ssl.default-vhost.conf\n||g;' \
$config
fi
done
if [ -e /usr/sbin/ADVXctl ]; then /usr/sbin/ADVXctl update;fi
fi