[ Agent ] [ Executor ] - agent启动脚本
This commit is contained in:
@@ -1,59 +1,59 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"agent-go/executor"
|
||||
logger2 "agent-go/logger"
|
||||
"agent-go/register"
|
||||
)
|
||||
|
||||
var log = logger2.Log
|
||||
|
||||
func main() {
|
||||
|
||||
var agentOP = &executor.AgentOsOperator{
|
||||
InstallCommandPrefix: []string{
|
||||
"apt-get", "install", "--allow-downgrades", "-y",
|
||||
},
|
||||
RemoveCommandPrefix: []string{"apt", "remove", "-y"},
|
||||
CanAccessInternet: true,
|
||||
IsOsTypeUbuntu: true,
|
||||
IsAgentInnerWall: false,
|
||||
AgentArch: "amd64",
|
||||
AgentOSReleaseCode: "focal",
|
||||
AgentServerInfo: ®ister.AgentServerInfo{
|
||||
ServerName: "",
|
||||
ServerIPPbV4: "158.247.241.43",
|
||||
ServerIPInV4: "10.0.4.6",
|
||||
ServerIPPbV6: "",
|
||||
ServerIPInV6: "",
|
||||
Location: "",
|
||||
Provider: "",
|
||||
ManagePort: "",
|
||||
CPUCore: "",
|
||||
CPUBrand: "",
|
||||
OSInfo: "",
|
||||
OSKernelInfo: "",
|
||||
TCPControl: "",
|
||||
Virtualization: "",
|
||||
IoSpeed: "",
|
||||
MemoryTotal: "",
|
||||
DiskTotal: "",
|
||||
DiskUsage: "",
|
||||
Comment: "",
|
||||
MachineID: "",
|
||||
AgentVersion: "",
|
||||
TopicName: "",
|
||||
},
|
||||
OssOfflinePrefix: "https://oss-s1.107421.xyz/",
|
||||
}
|
||||
|
||||
//executor.BasicPrettyPrint(agentOP.Exec("shutdownFirewall"))
|
||||
//executor.BasicPrettyPrint(agentOP.Exec("modifyHostname", "seoul-amd64-07"))
|
||||
//executor.BasicPrettyPrint(agentOP.Exec("disableSwap"))
|
||||
//executor.BasicPrettyPrint(agentOP.Exec("removeDocker"))
|
||||
//executor.BasicPrettyPrint(agentOP.Exec("installDocker", "20"))
|
||||
//executor.BasicPrettyPrint(agentOP.Exec("removeDockerCompose"))
|
||||
executor.BasicPrettyPrint(agentOP.Exec("installDockerCompose"))
|
||||
executor.BasicPrettyPrint(agentOP.Exec("installZSH"))
|
||||
|
||||
}
|
||||
//import (
|
||||
// "agent-go/executor"
|
||||
// logger2 "agent-go/logger"
|
||||
// "agent-go/register"
|
||||
//)
|
||||
//
|
||||
//var log = logger2.Log
|
||||
//
|
||||
//func main() {
|
||||
//
|
||||
// var agentOP = &executor.AgentOsOperator{
|
||||
// InstallCommandPrefix: []string{
|
||||
// "apt-get", "install", "--allow-downgrades", "-y",
|
||||
// },
|
||||
// RemoveCommandPrefix: []string{"apt", "remove", "-y"},
|
||||
// CanAccessInternet: true,
|
||||
// IsOsTypeUbuntu: true,
|
||||
// IsAgentInnerWall: false,
|
||||
// AgentArch: "amd64",
|
||||
// AgentOSReleaseCode: "focal",
|
||||
// AgentServerInfo: ®ister.AgentServerInfo{
|
||||
// ServerName: "",
|
||||
// ServerIPPbV4: "158.247.241.43",
|
||||
// ServerIPInV4: "10.0.4.6",
|
||||
// ServerIPPbV6: "",
|
||||
// ServerIPInV6: "",
|
||||
// Location: "",
|
||||
// Provider: "",
|
||||
// ManagePort: "",
|
||||
// CPUCore: "",
|
||||
// CPUBrand: "",
|
||||
// OSInfo: "",
|
||||
// OSKernelInfo: "",
|
||||
// TCPControl: "",
|
||||
// Virtualization: "",
|
||||
// IoSpeed: "",
|
||||
// MemoryTotal: "",
|
||||
// DiskTotal: "",
|
||||
// DiskUsage: "",
|
||||
// Comment: "",
|
||||
// MachineID: "",
|
||||
// AgentVersion: "",
|
||||
// TopicName: "",
|
||||
// },
|
||||
// OssOfflinePrefix: "https://oss-s1.107421.xyz/",
|
||||
// }
|
||||
//
|
||||
// //executor.BasicPrettyPrint(agentOP.Exec("shutdownFirewall"))
|
||||
// //executor.BasicPrettyPrint(agentOP.Exec("modifyHostname", "seoul-amd64-07"))
|
||||
// //executor.BasicPrettyPrint(agentOP.Exec("disableSwap"))
|
||||
// //executor.BasicPrettyPrint(agentOP.Exec("removeDocker"))
|
||||
// //executor.BasicPrettyPrint(agentOP.Exec("installDocker", "20"))
|
||||
// //executor.BasicPrettyPrint(agentOP.Exec("removeDockerCompose"))
|
||||
// executor.BasicPrettyPrint(agentOP.Exec("installDockerCompose"))
|
||||
// executor.BasicPrettyPrint(agentOP.Exec("installZSH"))
|
||||
//
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user