diff options
author | Marius Halden <marius.h@lden.org> | 2014-03-17 19:10:00 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2014-03-17 19:10:00 +0100 |
commit | d398793a759acc1d8bf2484f3533d0e9744bd429 (patch) | |
tree | ce453af337ad0fb94aacb6b445ce01cd7e1f717d /run.py | |
parent | 144427894721bb54baa08a7584e850277681c71b (diff) | |
download | DDNS.py-d398793a759acc1d8bf2484f3533d0e9744bd429.tar.gz DDNS.py-d398793a759acc1d8bf2484f3533d0e9744bd429.tar.bz2 DDNS.py-d398793a759acc1d8bf2484f3533d0e9744bd429.tar.xz |
Chaged where the configfile is defined and how the config is used
Diffstat (limited to 'run.py')
-rwxr-xr-x | run.py | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -1,5 +1,14 @@ #!/usr/bin/env python import ddns +import os +import ddns.cfg_parser -if __name__ == '__main__': - ddns.app.run(host="0.0.0.0", debug=True) +if os.environ.get('DDNS_CFG_PATH'): + cfg_file = os.environ['DDNS_CFG_PATH'] +else: + cfg_file = os.path.dirname(os.path.realpath(__file__)) + '/ddns.cfg' + +ddns.cfg_parser.cfg_file = cfg_file +ddns.cfg_parser.read_config() + +ddns.app.run(debug=True) |