Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
df75a6b1
Commit
df75a6b1
authored
14 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Script to load demo works with sudo and all versions
parent
d912c515
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dev/initdata/initdemo.sh
+38
-14
38 additions, 14 deletions
dev/initdata/initdemo.sh
dev/initdata/mysqldump_dolibarr_2.9.0.sql
+0
-0
0 additions, 0 deletions
dev/initdata/mysqldump_dolibarr_2.9.0.sql
dev/initdata/mysqldump_dolibarr_3.0.0.sql
+5272
-0
5272 additions, 0 deletions
dev/initdata/mysqldump_dolibarr_3.0.0.sql
with
5310 additions
and
14 deletions
dev/initdata/initdemo.sh
+
38
−
14
View file @
df75a6b1
#!/bin/sh
#!/bin/
ba
sh
#------------------------------------------------------
# Script to purge and init a database with demo values.
# Note: "dialog" tool need to be available.
#
# Regis Houssin - regis@dolibarr.fr
# Regis Houssin
- regis@dolibarr.fr
# Laurent Destailleur - eldy@users.sourceforge.net
#------------------------------------------------------
# WARNING: This script erase all data of database
# with data into
initdemo.sql
# with data into
dump file
#------------------------------------------------------
export
mydir
=
`
echo
"
$_
"
|
sed
-e
's/initdemo.sh//'
`
;
export
dumpfile
=
"mysqldump_dolibarr_3.0.0.sql"
export
mydir
=
`
echo
"
$0
"
|
sed
-e
's/initdemo.sh//'
`
;
if
[
"x
$mydir
"
=
"x"
]
then
export
mydir
=
"."
fi
export id
=
`
id
-u
`
;
# ----------------------------- check if root
if
[
"x
$id
"
!=
"x0"
-a
"x
$id
"
!=
"x1001"
]
then
...
...
@@ -20,13 +27,30 @@ then
exit
fi
# ----------------------------- input file
DIALOG
=
${
DIALOG
=dialog
}
DIALOG
=
"
$DIALOG
--ascii-lines"
fichtemp
=
`
tempfile 2>/dev/null
`
||
fichtemp
=
/tmp/test
$$
trap
"rm -f
$fichtemp
"
0 1 2 5 15
$DIALOG
--title
"Init Dolibarr with demo values"
--clear
\
--inputbox
"Input dump file :"
16 55
$dumpfile
2>
$fichtemp
valret
=
$?
case
$valret
in
0
)
dumpfile
=
`
cat
$fichtemp
`
;;
1
)
exit
;;
255
)
exit
;;
esac
# ----------------------------- database name
DIALOG
=
${
DIALOG
=dialog
}
DIALOG
=
"
$DIALOG
--ascii-lines"
fichtemp
=
`
tempfile 2>/dev/null
`
||
fichtemp
=
/tmp/test
$$
trap
"rm -f
$fichtemp
"
0 1 2 5 15
$DIALOG
--title
"Init Dolibarr with demo values"
--clear
\
--inputbox
"Mysql database name :"
16 5
1
dolibarrdemo 2>
$fichtemp
--inputbox
"Mysql database name :"
16 5
5
dolibarrdemo 2>
$fichtemp
valret
=
$?
case
$valret
in
0
)
...
...
@@ -42,7 +66,7 @@ DIALOG=${DIALOG=dialog}
fichtemp
=
`
tempfile 2>/dev/null
`
||
fichtemp
=
/tmp/test
$$
trap
"rm -f
$fichtemp
"
0 1 2 5 15
$DIALOG
--title
"Init Dolibarr with demo values"
--clear
\
--inputbox
"Mysql port (ex: 3306):"
16 5
1
3306 2>
$fichtemp
--inputbox
"Mysql port (ex: 3306):"
16 5
5
3306 2>
$fichtemp
valret
=
$?
...
...
@@ -60,7 +84,7 @@ DIALOG=${DIALOG=dialog}
fichtemp
=
`
tempfile 2>/dev/null
`
||
fichtemp
=
/tmp/test
$$
trap
"rm -f
$fichtemp
"
0 1 2 5 15
$DIALOG
--title
"Init Dolibarr with demo values"
--clear
\
--inputbox
"Mysql root login (ex: root):"
16 5
1
root 2>
$fichtemp
--inputbox
"Mysql root login (ex: root):"
16 5
5
root 2>
$fichtemp
valret
=
$?
...
...
@@ -78,7 +102,7 @@ DIALOG=${DIALOG=dialog}
fichtemp
=
`
tempfile 2>/dev/null
`
||
fichtemp
=
/tmp/test
$$
trap
"rm -f
$fichtemp
"
0 1 2 5 15
$DIALOG
--title
"Init Dolibarr with demo values"
--clear
\
--inputbox
"Password for Mysql root login :"
16 5
1
2>
$fichtemp
--inputbox
"Password for Mysql root login :"
16 5
5
2>
$fichtemp
valret
=
$?
...
...
@@ -96,7 +120,7 @@ esac
#fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
#trap "rm -f $fichtemp" 0 1 2 5 15
#$DIALOG --title "Init Dolibarr with demo values" --clear \
# --inputbox "Full path to documents directory (ex: /var/www/dolibarr/documents)- no / at end :" 16 5
1
2> $fichtemp
# --inputbox "Full path to documents directory (ex: /var/www/dolibarr/documents)- no / at end :" 16 5
5
2> $fichtemp
#valret=$?
...
...
@@ -112,7 +136,7 @@ esac
# ---------------------------- confirmation
DIALOG
=
${
DIALOG
=dialog
}
$DIALOG
--title
"Init Dolibarr with demo values"
--clear
\
--yesno
"Do you confirm ?
\n
Mysql database : '
$base
'
\n
Mysql port : '
$port
'
\n
Mysql login: '
$admin
'
\n
Mysql password : '
$passwd
'"
15
40
--yesno
"Do you confirm ?
\n
Dump file : '
$dumpfile
'
\n
Dump dir : '
$mydir
'
\n
Mysql database : '
$base
'
\n
Mysql port : '
$port
'
\n
Mysql login: '
$admin
'
\n
Mysql password : '
$passwd
'"
15
55
case
$?
in
0
)
echo
"Ok, start process..."
;;
...
...
@@ -125,10 +149,10 @@ if [ "x$passwd" != "x" ]
then
export
passwd
=
"-p
$passwd
"
fi
#echo "mysql -P$port -u$admin $passwd $base < $mydir/
initdemo.sql
"
#mysql -P$port -u$admin $passwd $base < $mydir/
initdemo.sql
echo
"mysql -P
$port
$base
<
$mydir
/
initdemo.sql
"
mysql
-P
$port
-u
$admin
$passwd
$base
<
$mydir
/
initdemo.sql
#echo "mysql -P$port -u$admin $passwd $base < $mydir/
$dumpfile
"
#mysql -P$port -u$admin $passwd $base < $mydir/
$dumpfile
echo
"mysql -P
$port
$base
<
$mydir
/
$dumpfile
"
mysql
-P
$port
-u
$admin
$passwd
$base
<
$mydir
/
$dumpfile
echo
"Dolibarr data demo has been loaded."
echo
This diff is collapsed.
Click to expand it.
dev/initdata/
initdemo
.sql
→
dev/initdata/
mysqldump_dolibarr_2.9.0
.sql
100644 → 100755
+
0
−
0
View file @
df75a6b1
File moved
This diff is collapsed.
Click to expand it.
dev/initdata/mysqldump_dolibarr_3.0.0.sql
0 → 100755
+
5272
−
0
View file @
df75a6b1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment