forked from dbca-wa/licensing-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstartup.sh
More file actions
33 lines (29 loc) · 718 Bytes
/
startup.sh
File metadata and controls
33 lines (29 loc) · 718 Bytes
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
#!/bin/bash
# Start the first process
env > /etc/.cronenv
sed -i 's/\"/\\"/g' /etc/.cronenv
cat /dev/urandom | tr -dc 'a-f0-9' | fold -w 32 | head -n 1 > /app/rand_hash
if [ $ENABLE_CRON == "True" ];
then
echo "Starting Cron"
service cron start &
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start cron: $status"
exit $status
fi
fi
if [ $ENABLE_WEB == "True" ];
then
echo "Starting Gunicorn"
# Start the second process
gunicorn licensing_template.wsgi --bind :8080 --config /app/gunicorn.ini
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start gunicorn: $status"
exit $status
fi
else
echo "ENABLE_WEB environment variable not set to True, web server is not starting."
/bin/bash
fi