This commit is contained in:
dongpd 2020-05-26 11:47:23 +07:00
parent 462681a1c9
commit acdbf18d9c

View File

@ -23,6 +23,12 @@ exports.ReadEngineConfig = async function (req, res) {
var path = '/root/monitor/setup/engine.json'; var path = '/root/monitor/setup/engine.json';
if (fs.existsSync(path)) { if (fs.existsSync(path)) {
var text = fs.readFileSync(path,'utf8'); var text = fs.readFileSync(path,'utf8');
if (text === "") {
const { execSync } = require('child_process');
execSync('rm /root/monitor/setup/engine.json');
execSync('sudo systemctl stop S905X_BI');
execSync('sudo systemctl disable S905X_BI');
}
res.send({status:true,data:text}); res.send({status:true,data:text});
} else { } else {
res.send({status:false}); res.send({status:false});