-
Notifications
You must be signed in to change notification settings - Fork 1
/
invenio-ctl.bash
executable file
·87 lines (69 loc) · 1.25 KB
/
invenio-ctl.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
APP_NAME=$(basename $0)
#
# This script can bring invenio-rdm down in an orderly fashion
# or start it back up.
#
function usage() {
cat <<EOT
% ${APP_NAME}() ${APP_NAME} user manual
% R. S. Doiel
% August 17, 2022
# NAME
${APP_NAME}
# SYNOPSIS
${APP_NAME} start|stop
# DESCRIPTION
Bring invenio-rdm up or down easily. This is a convence script only.
It is not terribly bright or robust!
# EXAMPLES
~~~shell
${APP_HELP} help
${APP_NAME} stop
${APP_NAME} start
~~~
EOT
}
function start_invenio() {
invenio-cli services start
sudo systemctl start rdm_celery
sudo systemctl start rdm_rest
sudo systemctl start rdm
sudo systemctl start nginx
}
function stop_invenio() {
sudo systemctl stop nginx
sudo systemctl stop rdm
sudo systemctl stop rdm_rest
sudo systemctl stop rdm_celery
invenio-cli services stop
}
function status_invenio() {
invenio-cli services status
echo "Press q each status response"
sudo systemctl status nginx
sudo systemctl status rdm
sudo systemctl status rdm_rest
sudo systemctl status rdm_celery
}
#
# Main entry script point.
#
case "$1" in
h|help|-h|--help)
usage
exit 0
;;
start)
start_invenio
;;
stop)
stop_invenio
;;
status)
status_invenio
;;
*)
usage
exit 1
esac