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');
|
||||
execSync('sudo systemctl stop S905X_BI');
|
||||
execSync('sudo systemctl disable S905X_BI');
|
||||
execSync('rm /root/monitor/setup/engine.json');
|
||||
|
||||
if (req.body.path !== "") {
|
||||
execSync('rm -rf ' + req.body.path);
|
||||
try {
|
||||
execSync('rm /root/monitor/setup/engine.json');
|
||||
} catch(err) {
|
||||
//console.log(err);
|
||||
}
|
||||
|
||||
if (req.body.path !== "") {
|
||||
try {
|
||||
execSync('rm -rf ' + req.body.path);
|
||||
} catch(err) {
|
||||
//console.log(err);
|
||||
}
|
||||
}
|
||||
res.send({status:true});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user