hotfix dmidecode 命令前添加 sudo

This commit is contained in:
cheney 2026-05-21 10:58:21 +08:00
parent b6928978de
commit c1f3deb559
3 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@
<groupId>com.sunyard.cisd</groupId> <groupId>com.sunyard.cisd</groupId>
<artifactId>device-fingerprint-tool</artifactId> <artifactId>device-fingerprint-tool</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
<name>device-fingerprint-tool</name> <name>device-fingerprint-tool</name>
<description>设备指纹信息获取工具</description> <description>设备指纹信息获取工具</description>

View File

@ -58,11 +58,11 @@ public class DeviceFingerprintService {
} }
private String getCpuModel() { private String getCpuModel() {
return executeCommand("dmidecode -t processor | grep \"Version\" | awk -F\\ '{print $2$3$4}'"); return executeCommand("sudo dmidecode -t processor | grep \"Version\" | awk -F\\ '{print $2$3$4}'");
} }
private String getCpuSerialNumber() { private String getCpuSerialNumber() {
return executeCommand("dmidecode -t processor | grep \"Serial Number\" | awk -F\\ '{print $3}'"); return executeCommand("sudo dmidecode -t processor | grep \"Serial Number\" | awk -F\\ '{print $3}'");
} }
private String getHardDiskSerialNumber() { private String getHardDiskSerialNumber() {

View File

@ -128,7 +128,7 @@
<dependency> <dependency>
<groupId>com.sunyard.cisd</groupId> <groupId>com.sunyard.cisd</groupId>
<artifactId>device-fingerprint-tool</artifactId> <artifactId>device-fingerprint-tool</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</dependency> </dependency>
</dependencies> </dependencies>