From ed38156e770e298d654ca3b6c3054249cb533c25 Mon Sep 17 00:00:00 2001 From: fram3d Date: Thu, 18 Jan 2024 14:26:27 +0100 Subject: [PATCH] add sql db and config file to install scripts for saving --- build-deb/taskmanager/DEBIAN/postinst | 8 ++++++++ build-deb/taskmanager/DEBIAN/preinst | 6 ++++++ build-deb/taskmanager/DEBIAN/prerm | 6 ++++++ 3 files changed, 20 insertions(+) create mode 100755 build-deb/taskmanager/DEBIAN/preinst diff --git a/build-deb/taskmanager/DEBIAN/postinst b/build-deb/taskmanager/DEBIAN/postinst index 5e79f60..cdb843c 100755 --- a/build-deb/taskmanager/DEBIAN/postinst +++ b/build-deb/taskmanager/DEBIAN/postinst @@ -2,3 +2,11 @@ /usr/bin/systemctl enable taskmanager.service /var/taskmanager/init_db.py /sbin/service taskmanager start +if [ -f /tmp/oldtaskmanagerconfig.ini ] ; then + cp /tmp/oldtaskmanagerconfig.ini /var/taskmanager/taskmanager/config.ini + rm /tmp/oldtaskmanagerconfig.ini +fi +if [ -f /tmp/oldtaskmanager.db ] ; then + cp /tmp/oldtaskmanager.db /var/taskmanager/instance/taskmanager.db + rm /tmp/oldtaskmanager.db +fi diff --git a/build-deb/taskmanager/DEBIAN/preinst b/build-deb/taskmanager/DEBIAN/preinst new file mode 100755 index 0000000..1af9acc --- /dev/null +++ b/build-deb/taskmanager/DEBIAN/preinst @@ -0,0 +1,6 @@ +if [ -f /var/taskmanager/taskmanager/config.ini ] ; then + cp /var/taskmanager/taskmanager/config.ini /tmp/oldtaskmanagerconfig.ini +fi +if [ -f /var/taskmanager/instance/taskmanager.db ] ; then + cp /var/taskmanager/instance/taskmanager.db /tmp/oldtaskmanager.db +fi diff --git a/build-deb/taskmanager/DEBIAN/prerm b/build-deb/taskmanager/DEBIAN/prerm index 7bfebe3..7dc04df 100755 --- a/build-deb/taskmanager/DEBIAN/prerm +++ b/build-deb/taskmanager/DEBIAN/prerm @@ -1,3 +1,9 @@ #!/bin/sh /sbin/service taskmanager stop /usr/bin/systemctl disable taskmanager.service +if [ -f /var/taskmanager/taskmanager/config.ini ] ; then + cp /var/taskmanager/taskmanager/config.ini /tmp/oldtaskmanagerconfig.ini +fi +if [ -f /var/taskmanager/instance/taskmanager.db ] ; then + cp /var/taskmanager/instance/taskmanager.db /tmp/oldtaskmanager.db +fi