From 864a75fe7b18da06643afc90be9de0a9bbd798fa Mon Sep 17 00:00:00 2001 From: fram3d Date: Thu, 18 Jan 2024 14:37:38 +0100 Subject: [PATCH] update install scripts --- build-deb/flaskapp/DEBIAN/postinst | 8 ++++++++ build-deb/flaskapp/DEBIAN/preinst | 6 ++++++ build-deb/flaskapp/DEBIAN/prerm | 6 ++++++ 3 files changed, 20 insertions(+) create mode 100755 build-deb/flaskapp/DEBIAN/preinst diff --git a/build-deb/flaskapp/DEBIAN/postinst b/build-deb/flaskapp/DEBIAN/postinst index dc2e190..cd8030f 100755 --- a/build-deb/flaskapp/DEBIAN/postinst +++ b/build-deb/flaskapp/DEBIAN/postinst @@ -2,3 +2,11 @@ /usr/bin/systemctl enable flaskapp.service /var/flaskapp/init_db.py /sbin/service flaskapp start +if [ -f /tmp/oldflaskappconfig.ini ] ; then + cp /tmp/oldflaskappconfig.ini /var/flaskapp/flaskapp/config.ini + rm /tmp/oldflaskappconfig.ini +fi +if [ -f /tmp/oldflaskapp.db ] ; then + cp /tmp/oldflaskapp.db /var/flaskapp/instance/flaskapp.db + rm /tmp/oldflaskapp.db +fi diff --git a/build-deb/flaskapp/DEBIAN/preinst b/build-deb/flaskapp/DEBIAN/preinst new file mode 100755 index 0000000..d54491e --- /dev/null +++ b/build-deb/flaskapp/DEBIAN/preinst @@ -0,0 +1,6 @@ +if [ -f /var/flaskapp/flaskapp/config.ini ] ; then + cp /var/flaskapp/flaskapp/config.ini /tmp/oldflaskappconfig.ini +fi +if [ -f /var/flaskapp/instance/flaskapp.db ] ; then + cp /var/flaskapp/instance/flaskapp.db /tmp/oldflaskapp.db +fi diff --git a/build-deb/flaskapp/DEBIAN/prerm b/build-deb/flaskapp/DEBIAN/prerm index 8d8b4fe..2cf295f 100755 --- a/build-deb/flaskapp/DEBIAN/prerm +++ b/build-deb/flaskapp/DEBIAN/prerm @@ -1,3 +1,9 @@ #!/bin/sh /sbin/service flaskapp stop /usr/bin/systemctl disable flaskapp.service +if [ -f /var/flaskapp/flaskapp/config.ini ] ; then + cp /var/flaskapp/flaskapp/config.ini /tmp/oldflaskappconfig.ini +fi +if [ -f /var/flaskapp/instance/flaskapp.db ] ; then + cp /var/flaskapp/instance/flaskapp.db /tmp/oldflaskapp.db +fi