MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / checkDockerIntegrity

Function checkDockerIntegrity

sub/sub.ts:41–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40// 检查Docker完整性
41async function checkDockerIntegrity(): Promise<{
42 valid: boolean;
43 error?: string;
44}> {
45 try {
46 await sh("which docker");
47 await sh("systemctl is-active docker");
48 await sh("docker info");
49 return { valid: true };
50 } catch (error: any) {
51 if (error.message.includes("Cannot connect to the Docker daemon")) {
52 return { valid: false, error: "Docker服务未运行" };
53 }
54 if (error.message.includes("docker: command not found")) {
55 return { valid: false, error: "Docker未安装" };
56 }
57 return { valid: false, error: "Docker配置异常" };
58 }
59}
60
61// 获取Sub-Store版本
62async function getSubStoreVersion(): Promise<string> {

Callers 1

SubStorePluginClass · 0.85

Calls 1

shFunction · 0.85

Tested by

no test coverage detected