glass-isc-dhcp/core/glass-config-watcher.js

17 lines
453 B
JavaScript
Raw Normal View History

2018-08-14 10:45:48 +02:00
var fs = require('fs');
var json_file = require('jsonfile');
module.exports = {
init: function () {
console.log("[Glass Server] Config watcher initialized");
fs.watch('config/glass_config.json', function (event, filename) {
if (filename) {
fsTimeout = setTimeout(function () {
glass_config = json_file.readFileSync('config/glass_config.json');
console.log("[Glass Server] Config Loaded");
}, 1000);
}
});
},
};