Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dolibarr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NoCloud
docker
Dolibarr
Commits
f2d35ff4
Verified
Commit
f2d35ff4
authored
9 months ago
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Improve doli, add logs and get_conf_var
parent
a08a41f8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doli
+26
-7
26 additions, 7 deletions
doli
with
26 additions
and
7 deletions
doli
+
26
−
7
View file @
f2d35ff4
#!/bin/bash
#!/bin/bash
get_conf_val
()
{
grep
$1
dolibarr_src/htdocs/conf/conf.php |
cut
-d
'='
-f
2 |
sed
-e
"s/^'//"
-e
"s/';
$/
/"
}
APP_SERVICE
=
"dolibarr"
APP_SERVICE
=
"dolibarr"
DB_SERVICE
=
"mariadb"
DB_SERVICE
=
"mariadb"
user
=
$
APP_SERVICE
user
=
$
(
get_conf_val main_db_user
)
db
=
$
APP_SERVICE
db
=
$
(
get_conf_val main_db_name
)
PASS_VARIABLE
=
"PASS"
PASS_VARIABLE
=
"PASS"
DUMP_PATH
=
"dumps/internal.sql.gz"
DUMP_PATH
=
"dumps/internal.sql.gz"
document_path
=
$(
get_conf_val main_data_root
)
is_docker
()
{
is_docker
()
{
if
[
!
-z
"
$(
which docker-compose 2>/dev/null
)
"
]
;
if
[
!
-z
"
$(
which docker-compose 2>/dev/null
)
"
]
;
...
@@ -25,6 +30,8 @@ usage() {
...
@@ -25,6 +30,8 @@ usage() {
echo
-e
"
\t
stops the docker stack"
echo
-e
"
\t
stops the docker stack"
echo
"help"
echo
"help"
echo
-e
"
\t
displays this messages and exit"
echo
-e
"
\t
displays this messages and exit"
echo
"logs"
echo
-e
"
\t
Follow all usefull logs"
echo
"mysql"
echo
"mysql"
echo
-e
"
\t
open a mysql prompt in LNB database"
echo
-e
"
\t
open a mysql prompt in LNB database"
echo
"mysql_dump"
echo
"mysql_dump"
...
@@ -56,7 +63,7 @@ else
...
@@ -56,7 +63,7 @@ else
cmdrestart
=
"apache2ctl restart"
cmdrestart
=
"apache2ctl restart"
fi
fi
pass
=
$(
awk
-F
'='
'/PASS/{print $2}'
.env
)
pass
=
$(
get_conf_val main_db_pass
)
mysql
=
"mariadb -u
$user
$db
-p
$pass
"
mysql
=
"mariadb -u
$user
$db
-p
$pass
"
DIR
=
"
$(
dirname
$0
)
"
DIR
=
"
$(
dirname
$0
)
"
...
@@ -73,6 +80,17 @@ case $action in
...
@@ -73,6 +80,17 @@ case $action in
"help"
)
"help"
)
usage
usage
;;
;;
"logs"
)
set
-x
$cmd
tail
-f
$document_path
/dolibarr.log
\
$document_path
/dolibarr_payment.log
\
$document_path
/dolibarr_cron.log
\
$document_path
/cron_run_jobs.php.log
\
$document_path
/dolibarr.log
\
/var/log/apache2/access.log
/var/log/apache2/error.log
set
+x
;;
"mysql"
)
"mysql"
)
set
-x
set
-x
$cmdmy
$mysql
$cmdmy
$mysql
...
@@ -112,10 +130,11 @@ case $action in
...
@@ -112,10 +130,11 @@ case $action in
esac
esac
;;
;;
"perms"
)
"perms"
)
$cmd
chown
-R
$(
id
-u
)
:33 dolibarr/
$cmd
chown
-R
$(
id
-u
)
:33 dolibarr_src/
$cmd
chmod
-R
g+w dolibarr/documents
$cmd
chown
-R
$(
id
-u
)
:33
$document_path
$cmd
chmod
-R
g-w dolibarr/htdocs
$cmd
chmod
-R
g+w
$document_path
$cmd
touch
dolibarr/documents/install.lock
$cmd
chmod
-R
g-w dolibarr_src/htdocs
$cmd
touch
$document_path
/install.lock
;;
;;
"restart"
)
"restart"
)
$cmdrestart
$@
$cmdrestart
$@
...
...
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