[agent-go] [Bastion] - install docker; docker-compose; install harbor
This commit is contained in:
@@ -3,10 +3,14 @@ package a_executor
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"wdd.io/agent-go/a_agent"
|
||||
"wdd.io/agent-go/a_executor/beans"
|
||||
)
|
||||
|
||||
var OctopusAgentInstallPrefix = "/root/wdd/"
|
||||
|
||||
type BaseFunc interface {
|
||||
|
||||
// Command 返回基础函数的命令行
|
||||
@@ -384,11 +388,11 @@ func (op *AgentOsOperator) installDefaultSSHKeyExec(funcArgs []string) (bool, []
|
||||
}
|
||||
|
||||
// download standard private and public key
|
||||
ok, resultLog := BasicDownloadFileByCurl(op.OssOfflinePrefix+"id_ed25519_private_key", "/root/.ssh/id_ed25519")
|
||||
ok, resultLog := BasicDownloadFile(op.OssOfflinePrefix+"id_ed25519_private_key", "", "", "", "/root/.ssh/id_ed25519")
|
||||
if !ok {
|
||||
return false, resultLog
|
||||
}
|
||||
ok, resultLog = BasicDownloadFileByCurl(op.OssOfflinePrefix+"id_ed25519_public_key.pub", "/root/.ssh/id_ed25519.pub")
|
||||
ok, resultLog = BasicDownloadFile(op.OssOfflinePrefix+"id_ed25519_public_key.pub", "", "", "", "/root/.ssh/id_ed25519.pub")
|
||||
if !ok {
|
||||
return false, resultLog
|
||||
}
|
||||
@@ -445,7 +449,6 @@ func (op *AgentOsOperator) removeDocker() [][]string {
|
||||
}
|
||||
|
||||
func (op *AgentOsOperator) removeDockerExec() (bool, []string) {
|
||||
var resultLog []string
|
||||
|
||||
dockerServiceStopCommand := [][]string{
|
||||
{
|
||||
@@ -467,7 +470,8 @@ func (op *AgentOsOperator) removeDockerExec() (bool, []string) {
|
||||
|
||||
ok, l := AllCompleteExecutor(dockerServiceStopCommand)
|
||||
if !ok {
|
||||
resultLog = append(resultLog, l...)
|
||||
log.Error("[removeDockerExec] - 停止docker服务失败!")
|
||||
return false, l
|
||||
}
|
||||
|
||||
dockerStaff := []string{
|
||||
@@ -491,14 +495,25 @@ func (op *AgentOsOperator) removeDockerExec() (bool, []string) {
|
||||
|
||||
for _, staff := range dockerStaff {
|
||||
removeCommand := append(op.RemoveCommandPrefix, staff)
|
||||
|
||||
ok, result := AllCommandExecutor(removeCommand)
|
||||
if !ok {
|
||||
resultLog = append(resultLog, result...)
|
||||
}
|
||||
AllCommandExecutor(removeCommand)
|
||||
}
|
||||
|
||||
return true, resultLog
|
||||
_ = os.Remove(beans.DockerServiceFile)
|
||||
_ = os.Remove(beans.DockerDaemonService)
|
||||
_ = os.Remove(beans.DockerSocketFile)
|
||||
|
||||
AllCommandExecutor([]string{
|
||||
"systemctl",
|
||||
"daemon-reload",
|
||||
})
|
||||
|
||||
return true, []string{
|
||||
"[removeDockerExec] - docker remove success !",
|
||||
}
|
||||
}
|
||||
|
||||
func (op *AgentOsOperator) RemoveDockerBastion() (bool, []string) {
|
||||
return op.removeDockerExec()
|
||||
}
|
||||
|
||||
func (op *AgentOsOperator) installDocker(args []string) [][]string {
|
||||
@@ -616,7 +631,7 @@ func (op *AgentOsOperator) installDocker(args []string) [][]string {
|
||||
|
||||
func (op *AgentOsOperator) installDockerExec(args []string) (bool, []string) {
|
||||
|
||||
BasicCreateFolder("/root/wdd/")
|
||||
BasicCreateFolder(OctopusAgentInstallPrefix)
|
||||
|
||||
op.removeDockerExec()
|
||||
|
||||
@@ -855,7 +870,7 @@ func (op *AgentOsOperator) installDockerOfflineExec(args []string) (bool, []stri
|
||||
dockerOfflineFileName = "docker-arm64-20.10.15.tgz"
|
||||
}
|
||||
|
||||
ok, resultLog := BasicDownloadFile(op.OssOfflinePrefix+dockerOfflineFileName, "", "", "", "/root/wdd/"+dockerOfflineFileName)
|
||||
ok, resultLog := BasicDownloadFile(op.OssOfflinePrefix+dockerOfflineFileName, "", "", "", OctopusAgentInstallPrefix+dockerOfflineFileName)
|
||||
if !ok {
|
||||
return false, resultLog
|
||||
}
|
||||
@@ -865,7 +880,7 @@ func (op *AgentOsOperator) installDockerOfflineExec(args []string) (bool, []stri
|
||||
PureResultSingleExecute([]string{
|
||||
"tar",
|
||||
"-vxf",
|
||||
"/root/wdd/" + dockerOfflineFileName,
|
||||
OctopusAgentInstallPrefix + dockerOfflineFileName,
|
||||
"-C",
|
||||
"/root/wdd",
|
||||
})
|
||||
@@ -878,17 +893,17 @@ func (op *AgentOsOperator) installDockerOfflineExec(args []string) (bool, []stri
|
||||
}
|
||||
|
||||
// systemd daemonize docker
|
||||
downloadOk, log2 := BasicDownloadFileByCurl(op.OssOfflinePrefix+"docker-containerd-daemon.service", "/lib/systemd/system/containerd.service")
|
||||
downloadOk, log2 := BasicDownloadFile(op.OssOfflinePrefix+"docker-containerd-daemon.service", "", "", "", beans.ContainerdServiceFile)
|
||||
if !downloadOk {
|
||||
return false, append(log2, "[installDockerOfflineExec] - daemon file download error !")
|
||||
}
|
||||
|
||||
downloadOk, log2 = BasicDownloadFileByCurl(op.OssOfflinePrefix+"docker-socket-daemon.service", "/lib/systemd/system/docker.socket")
|
||||
downloadOk, log2 = BasicDownloadFile(op.OssOfflinePrefix+"docker-socket-daemon.service", "", "", "", beans.DockerSocketDaemonService)
|
||||
if !downloadOk {
|
||||
return false, append(log2, "[installDockerOfflineExec] - daemon file download error !")
|
||||
}
|
||||
|
||||
downloadOk, log2 = BasicDownloadFileByCurl(op.OssOfflinePrefix+"docker-daemon.service", "/lib/systemd/system/docker.service")
|
||||
downloadOk, log2 = BasicDownloadFile(op.OssOfflinePrefix+"docker-daemon.service", "", "", "", beans.DockerServiceFile)
|
||||
if !downloadOk {
|
||||
return false, append(log2, "[installDockerOfflineExec] - daemon file download error !")
|
||||
}
|
||||
@@ -965,7 +980,7 @@ func (op *AgentOsOperator) InstallDockerBastion() (bool, []string) {
|
||||
|
||||
BasicRemoveFolderComplete("/root/wdd/docker")
|
||||
|
||||
dockerLocalFile := "/root/wdd/" + dockerOfflineFileName
|
||||
dockerLocalFile := OctopusAgentInstallPrefix + dockerOfflineFileName
|
||||
if !BasicFileExistAndNotNull(dockerLocalFile) {
|
||||
sprintf := fmt.Sprintf("docker offline file not exists ! => %s", dockerLocalFile)
|
||||
log.Error(sprintf)
|
||||
@@ -989,6 +1004,91 @@ func (op *AgentOsOperator) InstallDockerBastion() (bool, []string) {
|
||||
|
||||
// daemon docker
|
||||
|
||||
// systemd daemonize docker
|
||||
BasicAppendOverwriteContentToFile(beans.ContainerdDaemonService, beans.ContainerdServiceFile)
|
||||
if !BasicFileExistAndNotNull(beans.ContainerdServiceFile) {
|
||||
return false, []string{"docker deamon file not exists !"}
|
||||
}
|
||||
BasicAppendOverwriteContentToFile(beans.DockerSocketDaemonService, beans.DockerSocketFile)
|
||||
if !BasicFileExistAndNotNull(beans.DockerSocketFile) {
|
||||
return false, []string{"docker deamon file not exists !"}
|
||||
}
|
||||
BasicAppendOverwriteContentToFile(beans.DockerDaemonService, beans.DockerServiceFile)
|
||||
if !BasicFileExistAndNotNull(beans.DockerServiceFile) {
|
||||
return false, []string{"docker deamon file not exists !"}
|
||||
}
|
||||
log.InfoF("[InstallDockerBastion] - docker dameon file append success !")
|
||||
|
||||
// run the docker
|
||||
executor, log3 := AllCommandExecutor([]string{
|
||||
"systemctl",
|
||||
"daemon-reload",
|
||||
})
|
||||
if !executor {
|
||||
return false, append(log3, "[InstallDockerBastion] - daemon reload error !")
|
||||
}
|
||||
|
||||
AllCompleteExecutor([][]string{
|
||||
{
|
||||
"systemctl",
|
||||
"unmask",
|
||||
"containerd",
|
||||
},
|
||||
{
|
||||
"systemctl",
|
||||
"unmask",
|
||||
"docker.socket",
|
||||
},
|
||||
{
|
||||
"systemctl",
|
||||
"unmask",
|
||||
"docker",
|
||||
},
|
||||
})
|
||||
|
||||
AllCompleteExecutor([][]string{
|
||||
{
|
||||
"groupadd",
|
||||
"docker",
|
||||
},
|
||||
{
|
||||
"usermod",
|
||||
"-aG",
|
||||
"docker",
|
||||
"root",
|
||||
},
|
||||
{
|
||||
"newgrp",
|
||||
"docker",
|
||||
},
|
||||
})
|
||||
|
||||
systemdUp, _ := BasicSystemdUp("containerd")
|
||||
if !systemdUp {
|
||||
log.Warn("[InstallDockerBastion] - start containerd service error !")
|
||||
}
|
||||
|
||||
commandExecutor, _ := AllCompleteExecutor([][]string{
|
||||
{
|
||||
"systemctl",
|
||||
"start",
|
||||
"docker.socket",
|
||||
},
|
||||
{
|
||||
"systemctl",
|
||||
"enable",
|
||||
"docker.socket",
|
||||
},
|
||||
})
|
||||
if !commandExecutor {
|
||||
log.Warn("[InstallDockerBastion] - start docker.socket error !")
|
||||
}
|
||||
|
||||
up, log4 := BasicSystemdUp("docker")
|
||||
if !up {
|
||||
return false, append(log4, "[InstallDockerBastion] - start docker service error !")
|
||||
}
|
||||
|
||||
return true, []string{
|
||||
"[InstallDockerBastion] - docker offline installation from local success!",
|
||||
}
|
||||
@@ -1058,7 +1158,7 @@ func (op *AgentOsOperator) installDockerComposeExec() (bool, []string) {
|
||||
|
||||
log.InfoF("需要安装的docker版本为 => %s", DockerComposeFile)
|
||||
|
||||
ok, resultLog := BasicDownloadFileByCurl(DockerComposeFile, "/usr/local/bin/docker-compose")
|
||||
ok, resultLog := BasicDownloadFile(DockerComposeFile, "", "", "", "/usr/local/bin/docker-compose")
|
||||
if !ok {
|
||||
return false, resultLog
|
||||
}
|
||||
@@ -1091,7 +1191,7 @@ func (op *AgentOsOperator) installHelm() [][]string {
|
||||
{
|
||||
"mkdir",
|
||||
"-p",
|
||||
"/root/wdd/",
|
||||
OctopusAgentInstallPrefix,
|
||||
},
|
||||
{
|
||||
"rm",
|
||||
@@ -1212,7 +1312,7 @@ func (op *AgentOsOperator) modifyDockerConfigExec(args []string) (bool, []string
|
||||
}
|
||||
|
||||
// download new
|
||||
ok, resultLog := BasicDownloadFileByCurl(op.OssOfflinePrefix+"docker-daemon-template.json", dockerDaemonFile)
|
||||
ok, resultLog := BasicDownloadFile(op.OssOfflinePrefix+"docker-daemon-template.json", "", "", "", dockerDaemonFile)
|
||||
if !ok {
|
||||
return false, append(resultLog, "[modifyDockerConfigExec] - error download docker-daemon-template.json !")
|
||||
}
|
||||
@@ -1299,7 +1399,7 @@ func (op *AgentOsOperator) installNFSOfflineExec() (bool, []string) {
|
||||
nfsClientOfflinePackageOSSUrl := op.OssOfflinePrefix + nfsClientOfflinePackageName
|
||||
log.InfoF("[installNFSOfflineExec]- start to download nfs-client offline package from => %s", nfsClientOfflinePackageOSSUrl)
|
||||
|
||||
ok, resultLog := BasicDownloadFileByCurl(nfsClientOfflinePackageOSSUrl, "/root/wdd/"+nfsClientOfflinePackageName)
|
||||
ok, resultLog := BasicDownloadFile(nfsClientOfflinePackageOSSUrl, "", "", "", OctopusAgentInstallPrefix+nfsClientOfflinePackageName)
|
||||
if !ok {
|
||||
return false, append(resultLog, "[installNFSOfflineExec]- download nfs-client offline package error !", nfsClientOfflinePackageOSSUrl)
|
||||
}
|
||||
@@ -1310,7 +1410,7 @@ func (op *AgentOsOperator) installNFSOfflineExec() (bool, []string) {
|
||||
AllCommandExecutor([]string{
|
||||
"tar",
|
||||
"-zvxf",
|
||||
"/root/wdd/" + nfsClientOfflinePackageName,
|
||||
OctopusAgentInstallPrefix + nfsClientOfflinePackageName,
|
||||
"-C",
|
||||
"/root/wdd",
|
||||
})
|
||||
@@ -1429,7 +1529,7 @@ func (op *AgentOsOperator) installNFSServerOfflineExec() (bool, []string) {
|
||||
// download from oss
|
||||
nfsServerOfflinePackageOSSUrl := op.OssOfflinePrefix + nfsServerOfflinePackageName
|
||||
log.InfoF("[installNFSServerOfflineExec]- start to download nfs-server offline package from => %s", nfsServerOfflinePackageOSSUrl)
|
||||
ok, resultLog := BasicDownloadFileByCurl(nfsServerOfflinePackageOSSUrl, "/root/wdd/"+nfsServerOfflinePackageName)
|
||||
ok, resultLog := BasicDownloadFileByCurl(nfsServerOfflinePackageOSSUrl, OctopusAgentInstallPrefix+nfsServerOfflinePackageName)
|
||||
if !ok {
|
||||
return false, append(resultLog, "[installNFSServerOfflineExec]- download nfs-server offline package error !", nfsServerOfflinePackageOSSUrl)
|
||||
}
|
||||
@@ -1440,7 +1540,7 @@ func (op *AgentOsOperator) installNFSServerOfflineExec() (bool, []string) {
|
||||
AllCommandExecutor([]string{
|
||||
"tar",
|
||||
"-zvxf",
|
||||
"/root/wdd/" + nfsServerOfflinePackageName,
|
||||
OctopusAgentInstallPrefix + nfsServerOfflinePackageName,
|
||||
"-C",
|
||||
"/root/wdd",
|
||||
})
|
||||
@@ -1516,7 +1616,7 @@ func (op *AgentOsOperator) installHarbor() [][]string {
|
||||
//{
|
||||
// "mkdir",
|
||||
// "-p",
|
||||
// "/root/wdd/",
|
||||
// OctopusAgentInstallPrefix,
|
||||
//},
|
||||
//{
|
||||
// "rm",
|
||||
@@ -1535,7 +1635,7 @@ func (op *AgentOsOperator) installHarbor() [][]string {
|
||||
"-zvxf",
|
||||
"/root/wdd/harbor-offline-installer-v2.9.0.tgz",
|
||||
"-C",
|
||||
"/root/wdd/",
|
||||
OctopusAgentInstallPrefix,
|
||||
},
|
||||
{
|
||||
"rm",
|
||||
@@ -1575,12 +1675,9 @@ func (op *AgentOsOperator) installHarbor() [][]string {
|
||||
|
||||
return installHarborFunc
|
||||
}
|
||||
|
||||
// installHarborExec install harbor offline
|
||||
func (op *AgentOsOperator) installHarborExec() (bool, []string) {
|
||||
|
||||
func (op *AgentOsOperator) checkHarborInstallExec() (bool, []string) {
|
||||
// check docker-compose
|
||||
if !BasicFileExistAndNotNull("/usr/local/bin/docker-compose") {
|
||||
if !BasicCommandExistByPath("/usr/local/bin/docker-compose") {
|
||||
return false, []string{
|
||||
"[install harbor] - docker-compose uninstalled ! can't install harbor!",
|
||||
}
|
||||
@@ -1626,25 +1723,32 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
|
||||
"[install harbor] - script do not support for aarch64 version of harbor installation !",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// installHarborExec install harbor offline
|
||||
func (op *AgentOsOperator) installHarborExec() (bool, []string) {
|
||||
|
||||
// 抽离
|
||||
checkHarborInstallExec, i := op.checkHarborInstallExec()
|
||||
if !checkHarborInstallExec {
|
||||
return false, i
|
||||
}
|
||||
|
||||
// download offline file
|
||||
harborOfflineFileURL := op.OssOfflinePrefix + "harbor-offline-installer-v2.9.0.tgz"
|
||||
log.InfoF("[install harbor] - start to download harbor offline installer from => %s !", harborOfflineFileURL)
|
||||
|
||||
BasicCreateFolder("/root/wdd/")
|
||||
BasicCreateFolder(OctopusAgentInstallPrefix)
|
||||
|
||||
BasicRemoveFolderComplete("/root/wdd/harbor-offline-installer-v2.9.0.tgz")
|
||||
BasicRemoveFolderComplete("/root/wdd/harbor")
|
||||
|
||||
downloadOk, l := BasicDownloadFileByCurl(harborOfflineFileURL, "/root/wdd/harbor-offline-installer-v2.9.0.tgz")
|
||||
log.Info("[install harbor] - start to download harbor offline installation file!")
|
||||
downloadOk, l := BasicDownloadFile(harborOfflineFileURL, "", "", "", "/root/wdd/harbor-offline-installer-v2.9.0.tgz")
|
||||
if !downloadOk {
|
||||
return false, append(l, "download harbor offline installer failed!")
|
||||
}
|
||||
|
||||
if !BasicFileExistAndNotNull("/root/wdd/harbor-offline-installer-v2.9.0.tgz") {
|
||||
return false, []string{"download harbor offline installer failed!"}
|
||||
}
|
||||
|
||||
// unzip
|
||||
AllCompleteExecutor([][]string{
|
||||
{
|
||||
@@ -1652,7 +1756,7 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
|
||||
"-zvxf",
|
||||
"/root/wdd/harbor-offline-installer-v2.9.0.tgz",
|
||||
"-C",
|
||||
"/root/wdd/",
|
||||
OctopusAgentInstallPrefix,
|
||||
},
|
||||
{
|
||||
"rm",
|
||||
@@ -1663,17 +1767,25 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
|
||||
|
||||
// configuration
|
||||
log.Info("[install harbor] - start to download harbor config file!")
|
||||
AllCommandExecutor([]string{
|
||||
"wget",
|
||||
"--no-check-certificate",
|
||||
op.OssOfflinePrefix + "harbor-config-template.yml",
|
||||
"-qO",
|
||||
"/root/wdd/harbor/harbor.yml",
|
||||
})
|
||||
if !BasicFileExistAndNotNull("/root/wdd/harbor/harbor.yml") {
|
||||
return false, []string{"harbor config template file download error !"}
|
||||
ok, resultLog := BasicDownloadFile(op.OssOfflinePrefix+"harbor-config-template.yml", "", "", "", "/root/wdd/harbor/harbor.yml")
|
||||
if !ok {
|
||||
return false, resultLog
|
||||
}
|
||||
|
||||
// install and config
|
||||
installHarborAndConfig, i2 := op.installHarborAndConfig()
|
||||
if !installHarborAndConfig {
|
||||
return false, i2
|
||||
}
|
||||
|
||||
msg := "[install harbor] - harbor start complete !"
|
||||
log.Info(msg)
|
||||
|
||||
return true, []string{msg}
|
||||
}
|
||||
|
||||
func (op *AgentOsOperator) installHarborAndConfig() (bool, []string) {
|
||||
|
||||
log.Info("[install harbor] - start to modify harbor config file!")
|
||||
|
||||
AllCommandExecutor([]string{
|
||||
@@ -1686,7 +1798,8 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
|
||||
BasicReplace("/root/wdd/harbor/harbor.yml", "HarborHostPort", "8033")
|
||||
BasicReplace("/root/wdd/harbor/harbor.yml", "HarborAdminPas", "V2ryStr@ngPss")
|
||||
|
||||
log.InfoF("[install harbor] - harbor config changed success to => %s!", op.AgentServerInfo.ServerIPInV4)
|
||||
log.InfoF("[install harbor] - harbor config file changed to => %s %s %s !\n", op.AgentServerInfo.ServerIPInV4, "8033", "V2ryStr@ngPss")
|
||||
|
||||
// install
|
||||
log.Info("[install harbor] - going to start harbor !")
|
||||
executor := ReadTimeCommandExecutor([]string{
|
||||
@@ -1700,7 +1813,51 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
|
||||
}
|
||||
}
|
||||
|
||||
msg := "[install harbor] - harbor start complete !"
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (op *AgentOsOperator) InstallHarborBastion() (bool, []string) {
|
||||
// 抽离
|
||||
checkHarborInstallExec, i := op.checkHarborInstallExec()
|
||||
if !checkHarborInstallExec {
|
||||
return false, i
|
||||
}
|
||||
|
||||
// local file check exists
|
||||
if !BasicFileExistAndNotNull("/root/wdd/harbor-offline-installer-v2.9.0.tgz") {
|
||||
return false, []string{"[InstallHarborBastion] - harbor offline installer not exists !"}
|
||||
}
|
||||
|
||||
// unzip
|
||||
AllCompleteExecutor([][]string{
|
||||
{
|
||||
"tar",
|
||||
"-zvxf",
|
||||
"/root/wdd/harbor-offline-installer-v2.9.0.tgz",
|
||||
"-C",
|
||||
OctopusAgentInstallPrefix,
|
||||
},
|
||||
{
|
||||
"rm",
|
||||
"-rf",
|
||||
"/root/wdd/harbor/harbor.yml",
|
||||
},
|
||||
})
|
||||
|
||||
// configuration
|
||||
if !BasicAppendOverwriteContentToFile(beans.HarborTemplateFile, "/root/wdd/harbor/harbor.yml") {
|
||||
return false, []string{
|
||||
"[InstallHarborBastion] - harbor config file append failed !",
|
||||
}
|
||||
}
|
||||
|
||||
// install and config
|
||||
installHarborAndConfig, i2 := op.installHarborAndConfig()
|
||||
if !installHarborAndConfig {
|
||||
return false, i2
|
||||
}
|
||||
|
||||
msg := "[InstallHarborBastion] - harbor install SUCCESSES !"
|
||||
log.Info(msg)
|
||||
|
||||
return true, []string{msg}
|
||||
@@ -2197,7 +2354,7 @@ func (op *AgentOsOperator) installZSH() [][]string {
|
||||
{
|
||||
"mkdir",
|
||||
"-p",
|
||||
"/root/wdd/",
|
||||
OctopusAgentInstallPrefix,
|
||||
},
|
||||
append(
|
||||
op.InstallCommandPrefix,
|
||||
@@ -2331,7 +2488,7 @@ func (op *AgentOsOperator) installZSHExec() (bool, []string) {
|
||||
BasicRemoveFolderComplete("/root/.oh-my-zsh")
|
||||
BasicRemoveFolderComplete("/root/wdd/zsh-install.sh")
|
||||
BasicRemoveFolderComplete("/root/wdd/oh-my-zsh-plugins-list.txt")
|
||||
BasicCreateFolder("/root/wdd/")
|
||||
BasicCreateFolder(OctopusAgentInstallPrefix)
|
||||
|
||||
ok, resultLog := AllCommandExecutor(
|
||||
append(op.InstallCommandPrefix, "zsh", "git"))
|
||||
@@ -2348,7 +2505,7 @@ func (op *AgentOsOperator) installZSHExec() (bool, []string) {
|
||||
}
|
||||
log.InfoF("开始下载zsh的安装脚本 => %s", zshRemoteGitUrl)
|
||||
|
||||
resultOk, l := BasicDownloadFileByCurl(zshRemoteGitUrl, "/root/wdd/zsh-install.sh")
|
||||
resultOk, l := BasicDownloadFile(zshRemoteGitUrl, "", "", "", "/root/wdd/zsh-install.sh")
|
||||
if !resultOk {
|
||||
l = append(l, "zsh-install.sh 下载失败! 安装终止")
|
||||
return false, l
|
||||
|
||||
Reference in New Issue
Block a user