-
Notifications
You must be signed in to change notification settings - Fork 14
/
entrypoint.sh
executable file
·48 lines (44 loc) · 1.23 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
48
#!/bin/bash -e
source ${AKAUNTING_RUNTIME_DIR}/functions
[[ $DEBUG == true ]] && set -x
case ${1} in
app:akaunting|app:nginx|app:backup:create|app:backup:restore|artisan)
initialize_system
case ${1} in
app:akaunting)
configure_akaunting
echo "Starting Akaunting php5-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 $@
;;
artisan)
exec php $@
;;
esac
;;
app:help)
echo "Available options:"
echo " artisan - Launch the artisan command"
echo " app:akaunting - Starts the Akaunting 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