try catch
This commit is contained in:
parent
acdbf18d9c
commit
2fe3229317
|
@ -59,12 +59,19 @@ exports.Reset = async function (req, res) {
|
||||||
const { execSync } = require('child_process');
|
const { execSync } = require('child_process');
|
||||||
execSync('sudo systemctl stop S905X_BI');
|
execSync('sudo systemctl stop S905X_BI');
|
||||||
execSync('sudo systemctl disable S905X_BI');
|
execSync('sudo systemctl disable S905X_BI');
|
||||||
execSync('rm /root/monitor/setup/engine.json');
|
try {
|
||||||
|
execSync('rm /root/monitor/setup/engine.json');
|
||||||
if (req.body.path !== "") {
|
} catch(err) {
|
||||||
execSync('rm -rf ' + req.body.path);
|
//console.log(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (req.body.path !== "") {
|
||||||
|
try {
|
||||||
|
execSync('rm -rf ' + req.body.path);
|
||||||
|
} catch(err) {
|
||||||
|
//console.log(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
res.send({status:true});
|
res.send({status:true});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user