-
Notifications
You must be signed in to change notification settings - Fork 51
/
entrypoint.sh
executable file
·45 lines (41 loc) · 1.16 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
#!/bin/bash
set -e
source ${INVOICEPLANE_RUNTIME_DIR}/functions
[[ $DEBUG == true ]] && set -x
case ${1} in
app:invoiceplane|app:nginx|app:backup:create|app:backup:restore)
initialize_system
case ${1} in
app:invoiceplane)
configure_invoiceplane
echo "Starting InvoicePlane php"${PHP_VERSION}"-fpm..."
exec $(which php-fpm${PHP_VERSION}) -F
;;
app:nginx)
configure_nginx
echo "Starting nginx..."
exec $(which nginx) -c /etc/nginx/nginx.conf -g "daemon off;"
;;
app:backup:create)
shift 1
backup_create
;;
app:backup:restore)
shift 1
backup_restore $@
;;
esac
;;
app:help)
echo "Available options:"
echo " app:invoiceplane - Starts the InvoicePlane php5-fpm server (default)"
echo " app:nginx - Starts the nginx server"
echo " app:backup:create - Create a backup"
echo " app:backup:restore - Restore an existing backup"
echo " app:help - Displays the help"
echo " [command] - Execute the specified command, eg. bash."
;;
*)
exec "$@"
;;
esac