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