commit | author | age
|
eb8c9c
|
1 |
#!/bin/bash |
JK |
2 |
|
|
3 |
cd /webvirtmgr |
|
4 |
|
|
5 |
python manage.py collectstatic --noinput |
|
6 |
|
|
7 |
if [ ! -f "webvirtmgr/local/__init__.py" ]; then |
|
8 |
touch webvirtmgr/local/__init__.py |
|
9 |
fi |
|
10 |
|
|
11 |
if [ ! -f "webvirtmgr/local/local_settings.py" ]; then |
|
12 |
cp webvirtmgr/local_settings.py.initial webvirtmgr/local/local_settings.py |
|
13 |
cp webvirtmgr/local_settings.py.example webvirtmgr/local/ |
|
14 |
fi |
|
15 |
|
|
16 |
INITIALIZE=0 |
|
17 |
if [ ! -f "webvirtmgr/local/webvirtmgr.sqlite3" ]; then |
|
18 |
INITIALIZE=1 |
|
19 |
fi |
|
20 |
|
|
21 |
python manage.py syncdb --noinput |
|
22 |
|
|
23 |
if [ $INITIALIZE -ne 0 ]; then |
|
24 |
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@localhost', '1234')" | python manage.py shell |
|
25 |
touch webvirtmgr/local/webvirtmgr.sqlite3 |
|
26 |
fi |
|
27 |
|
|
28 |
exec python manage.py run_gunicorn -c /webvirtmgr/conf/gunicorn.conf.py |