#!/usr/bin/python
from edge.com import fs
from edge import path_helpers as ph
import ujson


_edge_jnode_dir = ph.get_edge_jnode_dirpath(ph.EDGE_TYPE_WEBSERVER, '0')
conf_abspath = fs.join_path(_edge_jnode_dir, 'main.conf')

with open(conf_abspath, 'r') as json_file:
    jnode = ujson.load(json_file)

jnode['WebServer']['Port'] = 8082
fs.write_json_file(jnode, conf_abspath, pretty=True)
