|
|
|
|
@ -1,13 +1,14 @@
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
#Controle du choix de version ou prise de la latest
|
|
|
|
|
[[ ! "$VERSION_GLPI" ]] \
|
|
|
|
|
&& VERSION_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep tag_name | cut -d '"' -f 4)
|
|
|
|
|
[[ ! "$VERSION_GLPI" ]] &&
|
|
|
|
|
VERSION_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep tag_name | cut -d '"' -f 4)
|
|
|
|
|
|
|
|
|
|
if [[ -z "${TIMEZONE}" ]]; then echo "TIMEZONE is unset";
|
|
|
|
|
else n
|
|
|
|
|
echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.3/apache2/conf.d/timezone.ini;
|
|
|
|
|
echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.3/cli/conf.d/timezone.ini;
|
|
|
|
|
if [[ -z "${TIMEZONE}" ]]; then
|
|
|
|
|
echo "TIMEZONE is unset"
|
|
|
|
|
else
|
|
|
|
|
echo "date.timezone = \"$TIMEZONE\"" >/etc/php/8.3/apache2/conf.d/timezone.ini
|
|
|
|
|
echo "date.timezone = \"$TIMEZONE\"" >/etc/php/8.3/cli/conf.d/timezone.ini
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#Enable session.cookie_httponly
|
|
|
|
|
@ -17,15 +18,13 @@ FOLDER_GLPI=glpi/
|
|
|
|
|
FOLDER_WEB=/var/www/html/
|
|
|
|
|
|
|
|
|
|
#check if TLS_REQCERT is present
|
|
|
|
|
if !(grep -q "TLS_REQCERT" /etc/ldap/ldap.conf)
|
|
|
|
|
then
|
|
|
|
|
if !(grep -q "TLS_REQCERT" /etc/ldap/ldap.conf); then
|
|
|
|
|
echo "TLS_REQCERT isn't present"
|
|
|
|
|
echo -e "TLS_REQCERT\tnever" >>/etc/ldap/ldap.conf
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#Téléchargement et extraction des sources de GLPI
|
|
|
|
|
if [ "$(ls ${FOLDER_WEB}${FOLDER_GLPI}/bin)" ];
|
|
|
|
|
then
|
|
|
|
|
if [ "$(ls ${FOLDER_WEB}${FOLDER_GLPI}/bin)" ]; then
|
|
|
|
|
echo "GLPI is already installed"
|
|
|
|
|
else
|
|
|
|
|
SRC_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/tags/${VERSION_GLPI} | jq .assets[0].browser_download_url | tr -d \")
|
|
|
|
|
|