|
@@ -38,17 +38,19 @@ class CreeperxtsService extends CrudService {
|
|
// console.log(`sessionText=>${sessionText}`);
|
|
// console.log(`sessionText=>${sessionText}`);
|
|
// console.log(`sshObj=>${JSON.stringify(sshObj)}`);
|
|
// console.log(`sshObj=>${JSON.stringify(sshObj)}`);
|
|
const path_ = `${pathDir}/qnodes.txt`;
|
|
const path_ = `${pathDir}/qnodes.txt`;
|
|
- fs.access(path_, err => {
|
|
|
|
- if (err) {
|
|
|
|
- fs.writeFile(path_, sessionText, function(err) {
|
|
|
|
- if (err) throw err;
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- fs.appendFile(path_, sessionText, function(err) {
|
|
|
|
- if (err) throw err;
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ const writeRes = fs.writeFileSync(path_, sessionText);
|
|
|
|
+ this.ctx.service.creeperxtsread.qnodes();
|
|
|
|
+ // fs.access(path_, err => {
|
|
|
|
+ // if (err) {
|
|
|
|
+ // fs.writeFile(path_, sessionText, function(err) {
|
|
|
|
+ // if (err) throw err;
|
|
|
|
+ // });
|
|
|
|
+ // } else {
|
|
|
|
+ // fs.appendFile(path_, sessionText, function(err) {
|
|
|
|
+ // if (err) throw err;
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
},
|
|
},
|
|
};
|
|
};
|
|
const SSH = new SSH2Shell(host);
|
|
const SSH = new SSH2Shell(host);
|