-
-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathpython3-patchman.postinst
More file actions
33 lines (23 loc) · 990 Bytes
/
python3-patchman.postinst
File metadata and controls
33 lines (23 loc) · 990 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/sh -e
#DEBHELPER#
if [ "$1" = "configure" ] ; then
if ! grep /usr/lib/python3/dist-packages/patchman /etc/apache2/conf-available/patchman.conf >/dev/null 2>&1 ; then
sed -i -e "s/^\(Define patchman_pythonpath\).*/\1 \/usr\/lib\/python3\/dist-packages/" \
/etc/apache2/conf-available/patchman.conf
fi
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke enconf patchman.conf
adduser --system --group patchman-celery
usermod -a -G www-data patchman-celery
patchman-set-secret-key
chown www-data /etc/patchman/local_settings.py
mkdir -p /var/lib/patchman/db
patchman-manage collectstatic --noinput
patchman-manage makemigrations
patchman-manage migrate --run-syncdb --fake-initial
sqlite3 /var/lib/patchman/db/patchman.db 'PRAGMA journal_mode=WAL;'
chown -R www-data:www-data /var/lib/patchman
echo
echo "Remember to run 'patchman-manage createsuperuser' to create a user."
echo
fi