add crontab scripts to build-deb and fix CONFIG_PATH in donationconfig.py
This commit is contained in:
parent
f410b78c8a
commit
c24ce7f2d9
7
build-deb/donationcalc/DEBIAN/postinst
Normal file
7
build-deb/donationcalc/DEBIAN/postinst
Normal file
@ -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
|
7
build-deb/donationcalc/DEBIAN/prerm
Normal file
7
build-deb/donationcalc/DEBIAN/prerm
Normal file
@ -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
|
@ -1,8 +1,7 @@
|
|||||||
import configparser
|
import configparser
|
||||||
|
|
||||||
class donationconfig():
|
class donationconfig():
|
||||||
#CONFIG_PATH = "/var/donationcalc/donationcalc/config.ini"
|
CONFIG_PATH = "/var/donationcalc/donationcalc/config.ini"
|
||||||
CONFIG_PATH = "/home/anon/src/donationcalc/donationcalc/config.ini"
|
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read(CONFIG_PATH)
|
config.read(CONFIG_PATH)
|
||||||
|
|
||||||
|
@ -1,2 +1 @@
|
|||||||
flask
|
flask
|
||||||
schedule
|
|
||||||
|
Loading…
Reference in New Issue
Block a user