优化部分代码
This commit is contained in:
parent
9155cb27a6
commit
9a31a4593b
4
pom.xml
4
pom.xml
@ -32,7 +32,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||||
<version>3.0.2</version>
|
<version>3.0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -58,7 +58,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
<artifactId>mybatis-spring-boot-starter-test</artifactId>
|
<artifactId>mybatis-spring-boot-starter-test</artifactId>
|
||||||
<version>3.0.2</version>
|
<version>3.0.3</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|||||||
@ -61,16 +61,12 @@ public class IoUtil {
|
|||||||
cpuInfo = OshiUtil.getCpuInfo();
|
cpuInfo = OshiUtil.getCpuInfo();
|
||||||
globalMemory = OshiUtil.getMemory();
|
globalMemory = OshiUtil.getMemory();
|
||||||
|
|
||||||
for (NetworkIF nif : networkIFs) {
|
for (NetworkIF nif : networkIFs)
|
||||||
if (SystemUtil.getOsInfo().isLinux()) {
|
if (nif.getName().startsWith("eth") || nif.getName().startsWith("ens")) {
|
||||||
if (nif.getName().equals("eth0") || nif.getName().equals("ens33"))
|
|
||||||
networkIF = nif;
|
|
||||||
} else if (nif.getName().equals("eth4") || nif.getName().equals("ethernet_32769"))
|
|
||||||
networkIF = nif;
|
networkIF = nif;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(networkIF == null)
|
if(networkIF == null)
|
||||||
log.error("网卡 eth0 不存在");
|
log.error("网卡 eth0 不存在");
|
||||||
else{
|
else{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user