eole-lemonldap/posttemplate/70-lemon-nginx

30 lines
803 B
Bash
Executable File

#!/bin/bash
ENABLE=$(CreoleGet activerLemon 'non')
if [ "$(CreoleGet activer_nginx_web non)" = 'oui' ];then
SERVER=nginx
else
SERVER=apache2
fi
SERVICES="manager"
SERVICES="${SERVICES} handler"
SERVICES="${SERVICES} portal"
for SERVICE in ${SERVICES}
do
if [ -L /etc/nginx/sites-enabled/${SERVICE}-nginx.conf ];then
rm /etc/nginx/sites-enabled/${SERVICE}-nginx.conf
fi
if [ -L /etc/apache2/sites-enabled/${SERVICE}-apache2.conf ];then
a2dissite ${SERVICE}-apache2
fi
if [ "${ENABLE}" = 'oui' ];then
if [ "${SERVER}" = 'nginx' ];then
ln -s /etc/nginx/sites-available/${SERVICE}-nginx.conf /etc/nginx/sites-enabled/${SERVICE}-nginx.conf
elif [ "${SERVER}" = 'apache2' ];then
a2ensite ${SERVICE}-apache2.conf
fi
fi
done