eole-lemonldap/posttemplate/70-lemon-nginx

30 lines
803 B
Plaintext
Raw Normal View History

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