diff --git a/mqtt_srv.py b/mqtt_srv.py index 57c12ba..ade733a 100755 --- a/mqtt_srv.py +++ b/mqtt_srv.py @@ -18,11 +18,12 @@ import getopt import random import requests - -with open("/etc/mqtt_srv/mqtt_srv.cfg") as json_file: - config = json.load(json_file) - print(config) - +try: + with open("/etc/mqtt_srv/mqtt_srv.cfg") as json_file: + config = json.load(json_file) + print(config) +except: + config = {} #import psutil stats = {}