[agent-go] [Bastion] - install docker; docker-compose; install harbor
This commit is contained in:
@@ -578,6 +578,14 @@ func BasicDownloadFile(downloadUrl string, socksProxyUrl string, proxyUser strin
|
||||
return false, resultLog
|
||||
}
|
||||
|
||||
// check file exists
|
||||
existAndNotNull := BasicFileExistAndNotNull(desFile)
|
||||
if !existAndNotNull {
|
||||
return false, []string{
|
||||
"[BasicDownloadFile] - file not exist download error!",
|
||||
}
|
||||
}
|
||||
|
||||
return true, resultLog
|
||||
}
|
||||
|
||||
@@ -724,6 +732,17 @@ func BasicAppendContentToFile(content string, targetFile string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// BasicAppendOverwriteContentToFile 向目标文件中写入一些内容,覆盖源文件
|
||||
func BasicAppendOverwriteContentToFile(content string, targetFile string) bool {
|
||||
|
||||
err := os.Remove(targetFile)
|
||||
if err != nil {
|
||||
log.WarnF("[BasicAppendOverwriteContentToFile] - Error removing file: %s , error is %s", targetFile, err.Error())
|
||||
}
|
||||
|
||||
return BasicAppendContentToFile(content, targetFile)
|
||||
}
|
||||
|
||||
// BasicAppendNullToFile 清空一个文件
|
||||
func BasicAppendNullToFile(targetFile string) bool {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user