diff --git a/omr-admin-config.json b/omr-admin-config.json index 2adf9e3..3f94ade 100644 --- a/omr-admin-config.json +++ b/omr-admin-config.json @@ -1,4 +1,5 @@ { "user":"openmptcprouter", - "pass":"MySecretKey" + "pass":"MySecretKey", + "port":65500 } \ No newline at end of file diff --git a/omr-admin.py b/omr-admin.py index 56296b3..30c5f8c 100644 --- a/omr-admin.py +++ b/omr-admin.py @@ -344,4 +344,9 @@ def update(): return jsonify({'result': 'done'}) if __name__ == '__main__': - app.run(host='0.0.0.0',port=65500,ssl_context=('/etc/openmptcprouter-vps-admin/cert.pem','/etc/openmptcprouter-vps-admin/key.pem')) + with open('/etc/openmptcprouter-vps-admin/omr-admin-config.json') as f: + omr_config_data = json.load(f) + omrport=65500 + if 'port' in omr_config_data: + omrport = omr_config_data["port"] + app.run(host='0.0.0.0',port=omrport,ssl_context=('/etc/openmptcprouter-vps-admin/cert.pem','/etc/openmptcprouter-vps-admin/key.pem'))