Skip to content

Commit

Permalink
Fix logs concat
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Sep 7, 2024
1 parent 2adfa40 commit 586c1ac
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 28 deletions.
9 changes: 5 additions & 4 deletions docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,18 @@ function initializeDatabase()

if [[ ${DOLI_INIT_DEMO} -eq 1 ]]; then
mkdir -p /var/www/dev/initdemo/
> /var/www/documents/initdemo.log
versiondemo=`echo "${DOLI_VERSION}" | sed "s/^\([0-9]*\.[0-9]*\).*/\1.0/"`
echo "Get demo data from file https://raw.githubusercontent.com/Dolibarr/dolibarr/${DOLI_VERSION}/dev/initdemo/mysqldump_dolibarr_$versiondemo.sql ..."
curl -fLSs -o /var/www/dev/initdemo/initdemo.sql https://raw.githubusercontent.com/Dolibarr/dolibarr/${DOLI_VERSION}/dev/initdemo/mysqldump_dolibarr_$versiondemo.sql
for fileSQL in /var/www/dev/initdemo/*.sql; do
echo "Found demo data file, so we first drop table llx_accounting_system ..."
echo "mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e \"DROP TABLE llx_accounting_system\" > /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DROP TABLE llx_accounting_system" > /var/www/documents/initdemo.log 2>&1
echo "mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e \"DROP TABLE llx_accounting_system\" >> /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DROP TABLE llx_accounting_system" >> /var/www/documents/initdemo.log 2>&1
echo "Then we load demo data ${fileSQL} ..."
sed -i 's/--.*//g;' ${fileSQL}
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /var/www/documents/initdemo.log 2>&1
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdemo.log 2>&1
done
fi

Expand Down
15 changes: 11 additions & 4 deletions images/15.0.3-php7.4/docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# This script is run when the Docker web container is started.
# It is embedded into the Docker image of dolibarr/dolibarr.


# usage: get_env_value VAR [DEFAULT]
# ie: get_env_value 'XYZ_DB_PASSWORD' 'example'
Expand Down Expand Up @@ -152,6 +155,7 @@ function runScripts()
fi
}

# Function called to initialize the database (creation of tables and init data)
function initializeDatabase()
{
for fileSQL in /var/www/html/install/mysql/tables/*.sql; do
Expand Down Expand Up @@ -198,17 +202,18 @@ function initializeDatabase()

if [[ ${DOLI_INIT_DEMO} -eq 1 ]]; then
mkdir -p /var/www/dev/initdemo/
> /var/www/documents/initdemo.log
versiondemo=`echo "${DOLI_VERSION}" | sed "s/^\([0-9]*\.[0-9]*\).*/\1.0/"`
echo "Get demo data from file https://raw.githubusercontent.com/Dolibarr/dolibarr/${DOLI_VERSION}/dev/initdemo/mysqldump_dolibarr_$versiondemo.sql ..."
curl -fLSs -o /var/www/dev/initdemo/initdemo.sql https://raw.githubusercontent.com/Dolibarr/dolibarr/${DOLI_VERSION}/dev/initdemo/mysqldump_dolibarr_$versiondemo.sql
for fileSQL in /var/www/dev/initdemo/*.sql; do
echo "Found demo data file, so we first drop table llx_accounting_system ..."
echo "mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e \"DROP TABLE llx_accounting_system\" > /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DROP TABLE llx_accounting_system" > /var/www/documents/initdemo.log 2>&1
echo "mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e \"DROP TABLE llx_accounting_system\" >> /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DROP TABLE llx_accounting_system" >> /var/www/documents/initdemo.log 2>&1
echo "Then we load demo data ${fileSQL} ..."
sed -i 's/--.*//g;' ${fileSQL}
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /var/www/documents/initdemo.log 2>&1
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdemo.log 2>&1
done
fi

Expand Down Expand Up @@ -264,6 +269,8 @@ function run()
# If install of mysql database (and not install of cron) is requested
if [[ ${DOLI_INSTALL_AUTO} -eq 1 && ${DOLI_CRON} -ne 1 && ${DOLI_DB_TYPE} != "pgsql" ]]; then
echo "DOLI_INSTALL_AUTO is on, so we check to initialize or upgrade mariadb database"

# If install.lock does not exists, we launch the initializeDataze
if [[ ! -f /var/www/documents/install.lock ]]; then
waitForDataBase

Expand Down
15 changes: 11 additions & 4 deletions images/16.0.5-php8.1/docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# This script is run when the Docker web container is started.
# It is embedded into the Docker image of dolibarr/dolibarr.


# usage: get_env_value VAR [DEFAULT]
# ie: get_env_value 'XYZ_DB_PASSWORD' 'example'
Expand Down Expand Up @@ -152,6 +155,7 @@ function runScripts()
fi
}

# Function called to initialize the database (creation of tables and init data)
function initializeDatabase()
{
for fileSQL in /var/www/html/install/mysql/tables/*.sql; do
Expand Down Expand Up @@ -198,17 +202,18 @@ function initializeDatabase()

if [[ ${DOLI_INIT_DEMO} -eq 1 ]]; then
mkdir -p /var/www/dev/initdemo/
> /var/www/documents/initdemo.log
versiondemo=`echo "${DOLI_VERSION}" | sed "s/^\([0-9]*\.[0-9]*\).*/\1.0/"`
echo "Get demo data from file https://raw.githubusercontent.com/Dolibarr/dolibarr/${DOLI_VERSION}/dev/initdemo/mysqldump_dolibarr_$versiondemo.sql ..."
curl -fLSs -o /var/www/dev/initdemo/initdemo.sql https://raw.githubusercontent.com/Dolibarr/dolibarr/${DOLI_VERSION}/dev/initdemo/mysqldump_dolibarr_$versiondemo.sql
for fileSQL in /var/www/dev/initdemo/*.sql; do
echo "Found demo data file, so we first drop table llx_accounting_system ..."
echo "mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e \"DROP TABLE llx_accounting_system\" > /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DROP TABLE llx_accounting_system" > /var/www/documents/initdemo.log 2>&1
echo "mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e \"DROP TABLE llx_accounting_system\" >> /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DROP TABLE llx_accounting_system" >> /var/www/documents/initdemo.log 2>&1
echo "Then we load demo data ${fileSQL} ..."
sed -i 's/--.*//g;' ${fileSQL}
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /var/www/documents/initdemo.log 2>&1
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdemo.log 2>&1
done
fi

Expand Down Expand Up @@ -264,6 +269,8 @@ function run()
# If install of mysql database (and not install of cron) is requested
if [[ ${DOLI_INSTALL_AUTO} -eq 1 && ${DOLI_CRON} -ne 1 && ${DOLI_DB_TYPE} != "pgsql" ]]; then
echo "DOLI_INSTALL_AUTO is on, so we check to initialize or upgrade mariadb database"

# If install.lock does not exists, we launch the initializeDataze
if [[ ! -f /var/www/documents/install.lock ]]; then
waitForDataBase

Expand Down
15 changes: 11 additions & 4 deletions images/17.0.4-php8.1/docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# This script is run when the Docker web container is started.
# It is embedded into the Docker image of dolibarr/dolibarr.


# usage: get_env_value VAR [DEFAULT]
# ie: get_env_value 'XYZ_DB_PASSWORD' 'example'
Expand Down Expand Up @@ -152,6 +155,7 @@ function runScripts()
fi
}

# Function called to initialize the database (creation of tables and init data)
function initializeDatabase()
{
for fileSQL in /var/www/html/install/mysql/tables/*.sql; do
Expand Down Expand Up @@ -198,17 +202,18 @@ function initializeDatabase()

if [[ ${DOLI_INIT_DEMO} -eq 1 ]]; then
mkdir -p /var/www/dev/initdemo/
> /var/www/documents/initdemo.log
versiondemo=`echo "${DOLI_VERSION}" | sed "s/^\([0-9]*\.[0-9]*\).*/\1.0/"`
echo "Get demo data from file https://raw.githubusercontent.com/Dolibarr/dolibarr/${DOLI_VERSION}/dev/initdemo/mysqldump_dolibarr_$versiondemo.sql ..."
curl -fLSs -o /var/www/dev/initdemo/initdemo.sql https://raw.githubusercontent.com/Dolibarr/dolibarr/${DOLI_VERSION}/dev/initdemo/mysqldump_dolibarr_$versiondemo.sql
for fileSQL in /var/www/dev/initdemo/*.sql; do
echo "Found demo data file, so we first drop table llx_accounting_system ..."
echo "mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e \"DROP TABLE llx_accounting_system\" > /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DROP TABLE llx_accounting_system" > /var/www/documents/initdemo.log 2>&1
echo "mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e \"DROP TABLE llx_accounting_system\" >> /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DROP TABLE llx_accounting_system" >> /var/www/documents/initdemo.log 2>&1
echo "Then we load demo data ${fileSQL} ..."
sed -i 's/--.*//g;' ${fileSQL}
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /var/www/documents/initdemo.log 2>&1
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdemo.log 2>&1
done
fi

Expand Down Expand Up @@ -264,6 +269,8 @@ function run()
# If install of mysql database (and not install of cron) is requested
if [[ ${DOLI_INSTALL_AUTO} -eq 1 && ${DOLI_CRON} -ne 1 && ${DOLI_DB_TYPE} != "pgsql" ]]; then
echo "DOLI_INSTALL_AUTO is on, so we check to initialize or upgrade mariadb database"

# If install.lock does not exists, we launch the initializeDataze
if [[ ! -f /var/www/documents/install.lock ]]; then
waitForDataBase

Expand Down
15 changes: 11 additions & 4 deletions images/18.0.5-php8.1/docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# This script is run when the Docker web container is started.
# It is embedded into the Docker image of dolibarr/dolibarr.


# usage: get_env_value VAR [DEFAULT]
# ie: get_env_value 'XYZ_DB_PASSWORD' 'example'
Expand Down Expand Up @@ -152,6 +155,7 @@ function runScripts()
fi
}

# Function called to initialize the database (creation of tables and init data)
function initializeDatabase()
{
for fileSQL in /var/www/html/install/mysql/tables/*.sql; do
Expand Down Expand Up @@ -198,17 +202,18 @@ function initializeDatabase()

if [[ ${DOLI_INIT_DEMO} -eq 1 ]]; then
mkdir -p /var/www/dev/initdemo/
> /var/www/documents/initdemo.log
versiondemo=`echo "${DOLI_VERSION}" | sed "s/^\([0-9]*\.[0-9]*\).*/\1.0/"`
echo "Get demo data from file https://raw.githubusercontent.com/Dolibarr/dolibarr/${DOLI_VERSION}/dev/initdemo/mysqldump_dolibarr_$versiondemo.sql ..."
curl -fLSs -o /var/www/dev/initdemo/initdemo.sql https://raw.githubusercontent.com/Dolibarr/dolibarr/${DOLI_VERSION}/dev/initdemo/mysqldump_dolibarr_$versiondemo.sql
for fileSQL in /var/www/dev/initdemo/*.sql; do
echo "Found demo data file, so we first drop table llx_accounting_system ..."
echo "mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e \"DROP TABLE llx_accounting_system\" > /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DROP TABLE llx_accounting_system" > /var/www/documents/initdemo.log 2>&1
echo "mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e \"DROP TABLE llx_accounting_system\" >> /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DROP TABLE llx_accounting_system" >> /var/www/documents/initdemo.log 2>&1
echo "Then we load demo data ${fileSQL} ..."
sed -i 's/--.*//g;' ${fileSQL}
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /var/www/documents/initdemo.log 2>&1
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdemo.log 2>&1
done
fi

Expand Down Expand Up @@ -264,6 +269,8 @@ function run()
# If install of mysql database (and not install of cron) is requested
if [[ ${DOLI_INSTALL_AUTO} -eq 1 && ${DOLI_CRON} -ne 1 && ${DOLI_DB_TYPE} != "pgsql" ]]; then
echo "DOLI_INSTALL_AUTO is on, so we check to initialize or upgrade mariadb database"

# If install.lock does not exists, we launch the initializeDataze
if [[ ! -f /var/www/documents/install.lock ]]; then
waitForDataBase

Expand Down
15 changes: 11 additions & 4 deletions images/19.0.3-php8.2/docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# This script is run when the Docker web container is started.
# It is embedded into the Docker image of dolibarr/dolibarr.


# usage: get_env_value VAR [DEFAULT]
# ie: get_env_value 'XYZ_DB_PASSWORD' 'example'
Expand Down Expand Up @@ -152,6 +155,7 @@ function runScripts()
fi
}

# Function called to initialize the database (creation of tables and init data)
function initializeDatabase()
{
for fileSQL in /var/www/html/install/mysql/tables/*.sql; do
Expand Down Expand Up @@ -198,17 +202,18 @@ function initializeDatabase()

if [[ ${DOLI_INIT_DEMO} -eq 1 ]]; then
mkdir -p /var/www/dev/initdemo/
> /var/www/documents/initdemo.log
versiondemo=`echo "${DOLI_VERSION}" | sed "s/^\([0-9]*\.[0-9]*\).*/\1.0/"`
echo "Get demo data from file https://raw.githubusercontent.com/Dolibarr/dolibarr/${DOLI_VERSION}/dev/initdemo/mysqldump_dolibarr_$versiondemo.sql ..."
curl -fLSs -o /var/www/dev/initdemo/initdemo.sql https://raw.githubusercontent.com/Dolibarr/dolibarr/${DOLI_VERSION}/dev/initdemo/mysqldump_dolibarr_$versiondemo.sql
for fileSQL in /var/www/dev/initdemo/*.sql; do
echo "Found demo data file, so we first drop table llx_accounting_system ..."
echo "mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e \"DROP TABLE llx_accounting_system\" > /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DROP TABLE llx_accounting_system" > /var/www/documents/initdemo.log 2>&1
echo "mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e \"DROP TABLE llx_accounting_system\" >> /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DROP TABLE llx_accounting_system" >> /var/www/documents/initdemo.log 2>&1
echo "Then we load demo data ${fileSQL} ..."
sed -i 's/--.*//g;' ${fileSQL}
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /var/www/documents/initdemo.log 2>&1
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdemo.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdemo.log 2>&1
done
fi

Expand Down Expand Up @@ -264,6 +269,8 @@ function run()
# If install of mysql database (and not install of cron) is requested
if [[ ${DOLI_INSTALL_AUTO} -eq 1 && ${DOLI_CRON} -ne 1 && ${DOLI_DB_TYPE} != "pgsql" ]]; then
echo "DOLI_INSTALL_AUTO is on, so we check to initialize or upgrade mariadb database"

# If install.lock does not exists, we launch the initializeDataze
if [[ ! -f /var/www/documents/install.lock ]]; then
waitForDataBase

Expand Down
Loading

0 comments on commit 586c1ac

Please sign in to comment.