Fix initdemo

This commit is contained in:
Laurent Destailleur 2024-11-27 16:22:17 +01:00
parent c280593d7f
commit 22bd6bd108
2 changed files with 5 additions and 3 deletions

View File

@ -10,7 +10,7 @@ Init demo
The script `initdemo.sh` will erase the current database with data from `dev/initdemo/mysqldump_dolibarr_x.y.z.sql` and copy files from `documents_demo` to the official document directory.
You many to execute `chmod 700 initdemo.sh`
You may need to execute `chmod 700 initdemo.sh`
then run `./initdemo.sh` to launch the Graphical User Interface.
After loading the demo files, the admin login may be one of the following:

View File

@ -186,17 +186,19 @@ fi
if [ "$passwd" != "" ]
then
export passwd="-p$passwd"
export passwdshown="-p*****"
fi
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
#echo "drop old table"
echo "drop table"
echo "drop table if exists llx_accounting_account;" | mysql "-P$port" "-u$admin" "$passwd" "$base"
echo "mysql -P$port -u$admin -p***** $base < '$mydir/$dumpfile'"
echo "mysql -P$port -u$admin $passwdshown $base < '$mydir/$dumpfile'"
mysql "-P$port" "-u$admin" "$passwd" "$base" < "$mydir/$dumpfile"
export res=$?
if [ $res -ne 0 ]; then
echo "Error to load database dump with mysql -P$port -u$admin -p***** $base < '$mydir/$dumpfile'"
echo "Error to load database dump with: mysql -P$port -u$admin $passwdshown $base < '$mydir/$dumpfile'"
exit
fi