Enable logger with env var

This commit is contained in:
JP Meijers 2018-02-28 10:47:01 +02:00
parent 43f611a3d2
commit 992d6b6ce6

7
run.py
View File

@ -174,6 +174,11 @@ gateway_conf['contact_email'] = os.getenv('GW_CONTACT_EMAIL', "")
gateway_conf['description'] = description
gateway_conf['stat_file'] = 'loragwstat.json'
if(os.getenv('GW_LOGGER', "false")=="true"):
gateway_conf['logger'] = True
else:
gateway_conf['logger'] = False
if(os.getenv('GW_FWD_CRC_ERR', "false")=="true"):
#default is False
gateway_conf['forward_crc_error'] = True
@ -296,8 +301,6 @@ with open('/opt/ttn-gateway/global_conf.json', 'w') as the_file:
the_file.write(json.dumps(local_conf, indent=4))
# TODO: Cayenne monitoring script
# Endless loop to reset and restart packet forwarder
while True: