Skip to content

Commit

Permalink
Run component update in background only if db is already initialised …
Browse files Browse the repository at this point in the history
…on startup
  • Loading branch information
oivindoh committed Sep 3, 2024
1 parent a8d5b5b commit 65fc200
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 9 additions & 5 deletions core/files/configure_misp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,15 @@ init_settings() {
}

update_components() {
sudo -b -u www-data /var/www/MISP/app/Console/cake Admin updateGalaxies
sudo -b -u www-data /var/www/MISP/app/Console/cake Admin updateTaxonomies
sudo -b -u www-data /var/www/MISP/app/Console/cake Admin updateWarningLists
sudo -b -u www-data /var/www/MISP/app/Console/cake Admin updateNoticeLists
sudo -b -u www-data /var/www/MISP/app/Console/cake Admin updateObjectTemplates "$CRON_USER_ID"
UPDATE_SUDO_CMD="sudo -u www-data"
if [ ! -z "${DB_ALREADY_INITIALISED}" ]; then
UPDATE_SUDO_CMD="sudo -b -u www-data"
fi
${UPDATE_SUDO_CMD} /var/www/MISP/app/Console/cake Admin updateGalaxies
${UPDATE_SUDO_CMD} /var/www/MISP/app/Console/cake Admin updateTaxonomies
${UPDATE_SUDO_CMD} /var/www/MISP/app/Console/cake Admin updateWarningLists
${UPDATE_SUDO_CMD} /var/www/MISP/app/Console/cake Admin updateNoticeLists
${UPDATE_SUDO_CMD} /var/www/MISP/app/Console/cake Admin updateObjectTemplates "$CRON_USER_ID"
}

update_ca_certificates() {
Expand Down
1 change: 1 addition & 0 deletions core/files/entrypoint_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ init_mysql(){

if [ $(isDBinitDone) -eq 0 ]; then
echo "... database has already been initialized"
export DB_ALREADY_INITIALISED=true
else
echo "... database has not been initialized, importing MySQL scheme..."
$MYSQLCMD < /var/www/MISP/INSTALL/MYSQL.sql
Expand Down

0 comments on commit 65fc200

Please sign in to comment.