From 094aa13397001b9aa3aedc0b0aab09decd91571a Mon Sep 17 00:00:00 2001 From: fram3d Date: Wed, 17 Jan 2024 15:29:28 +0100 Subject: [PATCH] add running of init_db.py after installation --- build-deb/Makefile | 3 ++- build-deb/flaskapp/DEBIAN/postinst | 1 + build-deb/flaskapp/DEBIAN/prerm | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build-deb/Makefile b/build-deb/Makefile index f92c0fc..12897c9 100644 --- a/build-deb/Makefile +++ b/build-deb/Makefile @@ -7,11 +7,12 @@ man: man/flaskapp.1.md deb: man ../requirments.txt ../run.py ../flaskapp ../LICENSE cp -r ../flaskapp/* flaskapp/var/flaskapp/flaskapp/ cp ../run.py flaskapp/var/flaskapp/ + cp ../init_db.py flaskapp/var/flaskapp/ cp ../LICENSE flaskapp/var/flaskapp/ chmod -w flaskapp/DEBIAN/* chmod +w flaskapp/DEBIAN/control dpkg-deb --build flaskapp - chmod -w flaskapp/DEBIAN/* + chmod +w flaskapp/DEBIAN/* clean: rm -f flaskapp.deb rm -f man/flaskapp.1 diff --git a/build-deb/flaskapp/DEBIAN/postinst b/build-deb/flaskapp/DEBIAN/postinst index 6f104c8..dc2e190 100755 --- a/build-deb/flaskapp/DEBIAN/postinst +++ b/build-deb/flaskapp/DEBIAN/postinst @@ -1,3 +1,4 @@ #!/bin/sh /usr/bin/systemctl enable flaskapp.service +/var/flaskapp/init_db.py /sbin/service flaskapp start diff --git a/build-deb/flaskapp/DEBIAN/prerm b/build-deb/flaskapp/DEBIAN/prerm index ab24d80..8d8b4fe 100755 --- a/build-deb/flaskapp/DEBIAN/prerm +++ b/build-deb/flaskapp/DEBIAN/prerm @@ -1,3 +1,3 @@ #!/bin/sh /sbin/service flaskapp stop -/usr/bin/systemdctl disable flaskapp.service +/usr/bin/systemctl disable flaskapp.service