diff --git a/build-deb/donationcalc/DEBIAN/postinst b/build-deb/donationcalc/DEBIAN/postinst new file mode 100644 index 0000000..97c33ce --- /dev/null +++ b/build-deb/donationcalc/DEBIAN/postinst @@ -0,0 +1,7 @@ +#!/bin/sh + +/usr/bin/echo "Adding monthly rebalance to crontab" +/usr/bin/crontab -l > /tmp/donationcalccrontab.tmp +/usr/bin/echo "0 0 1 * * /usr/bin/python3 /var/donationcalc/run.py -r" >> /tmp/donationcalccrontab.tmp +/usr/bin/crontab /tmp/donationcalccrontab.tmp +/usr/bin/rm /tmp/donationcalccrontab.tmp diff --git a/build-deb/donationcalc/DEBIAN/prerm b/build-deb/donationcalc/DEBIAN/prerm new file mode 100644 index 0000000..5644be7 --- /dev/null +++ b/build-deb/donationcalc/DEBIAN/prerm @@ -0,0 +1,7 @@ +#!/bin/sh + +/usr/bin/echo "Removing monthly rebalance to crontab" +/usr/bin/crontab -l > /tmp/donationcalccrontab.tmp +/usr/bin/grep -v "0 0 1 * * /usr/bin/python3 /var/donationcalc/run.py -r" /tmp/donationcalccrontab.tmp >> /tmp/donationcalccrontab.tmp1 +/usr/bin/crontab /tmp/donationcalccrontab.tmp1 +/usr/bin/rm /tmp/donationcalccrontab.tmp /tmp/donationcalccrontab.tmp1 diff --git a/donationcalc/donationconfig.py b/donationcalc/donationconfig.py index 8e49f15..99b633d 100644 --- a/donationcalc/donationconfig.py +++ b/donationcalc/donationconfig.py @@ -1,8 +1,7 @@ import configparser class donationconfig(): - #CONFIG_PATH = "/var/donationcalc/donationcalc/config.ini" - CONFIG_PATH = "/home/anon/src/donationcalc/donationcalc/config.ini" + CONFIG_PATH = "/var/donationcalc/donationcalc/config.ini" config = configparser.ConfigParser() config.read(CONFIG_PATH) diff --git a/requirments.txt b/requirments.txt index 7acfc7f..7e10602 100644 --- a/requirments.txt +++ b/requirments.txt @@ -1,2 +1 @@ flask -schedule