-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·47 lines (42 loc) · 1.01 KB
/
entrypoint.sh
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
#!/bin/bash
set -e
initialize() {
mayan-edms.py initialsetup
cat /local.py >> /usr/local/lib/python2.7/dist-packages/mayan/settings/local.py
chown -R www-data:www-data /usr/local/lib/python2.7/dist-packages/mayan/
}
upgrade() {
mayan-edms.py performupgrade
}
start() {
rm -rf /var/run/supervisor.sock
exec /usr/bin/supervisord -nc /etc/supervisor/supervisord.conf
}
restart() {
supervisorctl restart all
}
case ${1} in
mayan:start)
start
;;
mayan:init)
initialize
;;
mayan:upgrade)
upgrade
;;
mayan:restart)
restart
;;
mayan:help)
echo "Available options:"
echo " app:start - Starts the server (default)"
echo " app:init - Initialize the installation (e.g. create databases, migrate database)."
echo " app:upgrade - Migrate an existing database to a current version."
echo " app:help - Displays the help"
echo " [command] - Execute the specified command, eg. bash."
;;
*)
exec "$@"
;;
esac