diff --git a/install/glpi-install.sh b/install/glpi-install.sh index d1f123350..7751b9e23 100644 --- a/install/glpi-install.sh +++ b/install/glpi-install.sh @@ -17,7 +17,7 @@ msg_info "Installing Dependencies" $STD apt-get install -y \ git \ apache2 \ - php8.2-{apcu,cli,common,curl,gd,imap,ldap,mysql,xmlrpc,xml,mbstring,bcmath,intl,zip,redis,bz2,soap} \ + php8.4-{apcu,cli,common,curl,gd,ldap,mysql,xmlrpc,xml,mbstring,bcmath,intl,zip,redis,bz2,soap} \ php-cas \ libapache2-mod-php msg_ok "Installed Dependencies" @@ -43,12 +43,11 @@ msg_ok "Set up database" msg_info "Installing GLPi" cd /opt -#RELEASE=$(curl -fsSL https://api.github.com/repos/glpi-project/glpi/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/') -curl -fsSL "https://github.com/glpi-project/glpi/releases/download/10.0.20/glpi-10.0.20.tgz" -o "glpi-10.0.20.tgz" -$STD tar -xzvf glpi-10.0.20.tgz +RELEASE=$(curl -fsSL https://api.github.com/repos/glpi-project/glpi/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/') +curl -fsSL "https://github.com/glpi-project/glpi/releases/download/${RELEASE}/glpi-${RELEASE}.tgz" -o $(basename "https://github.com/glpi-project/glpi/releases/download/${RELEASE}/glpi-${RELEASE}.tgz") +$STD tar -xzvf glpi-${RELEASE}.tgz cd /opt/glpi -$STD php bin/console db:install --db-name=$DB_NAME --db-user=$DB_USER --db-password=$DB_PASS --no-interaction -echo "10.0.20" >/opt/${APPLICATION}_version.txt +echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed GLPi" msg_info "Setting Downstream file" @@ -83,6 +82,18 @@ define('GLPI_LOG_DIR', '/var/log/glpi'); EOF msg_ok "Configured Downstream file" +msg_info "Configuring GLPI Database" +$STD /usr/bin/php /opt/glpi/bin/console db:install \ + --db-host=localhost \ + --db-name=$DB_NAME \ + --db-user=$DB_USER \ + --db-password=$DB_PASS \ + --default-language=en_US \ + --no-interaction \ + --allow-superuser \ + --force +msg_ok "Configured GLPI Database" + msg_info "Setting Folder and File Permissions" chown root:root /opt/glpi/ -R chown www-data:www-data /etc/glpi -R @@ -144,7 +155,7 @@ customize msg_info "Cleaning up" rm -rf /opt/glpi/install -rm -rf /opt/glpi-10.0.20.tgz +rm -rf /opt/glpi-${RELEASE}.tgz $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"