Skip to content

Commit

Permalink
perf: 打印ping不通信息 01-11
Browse files Browse the repository at this point in the history
  • Loading branch information
forhumility committed Jan 11, 2024
1 parent 7ea82ea commit 52e5dc0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lib/computer.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* @Author : Humility
* @Date : 2023-07-13 10:28:04
* @LastEditTime : 2023-07-28 16:29:08
* @LastEditors : LST-Public
* @FilePath : \miot-pc-switch-bemfa\src\lib\computer.ts
* @LastEditTime : 2024-01-11 16:07:27
* @LastEditors : Humility
* @FilePath : \humble-switch-bemfa\src\lib\computer.ts
* @Description :
*/
// 子进程
Expand Down Expand Up @@ -111,12 +111,14 @@ export class Computer extends BemfaDevice {
} else if (process.platform == "linux") {
pingCMD = `ping -c 1 -w 1 ${this.ip}`;
} else {
console.log(new Date(), "platform error");
console.log(new Date(), "platform not supported");
}
try {
execSync(pingCMD);
return 1;
} catch (error) {
console.log(new Date(), "get status error");
console.warn(error);
return 0;
}
}
Expand Down

0 comments on commit 52e5dc0

Please sign in to comment.