[ Agent ] [ App ] - offline build nfs server - 2

This commit is contained in:
zeaslity
2023-12-14 16:51:06 +08:00
parent 37fb9c3a8d
commit 3784a24c38

View File

@@ -1098,6 +1098,9 @@ func (op *AgentOsOperator) installNfsOnlineExec() (bool, []string) {
func (op *AgentOsOperator) installNFSOfflineExec() (bool, []string) {
log.InfoF("[installNFSOfflineExec] - start to install nfs-client offline !")
BasicCreateFolder("/root/install")
// check for version
executor, i := HardCodeCommandExecutor("grep PRETTY_NAME /etc/os-release | cut -d= -f2 | tr -d '\"' | sed 's/ /-/g'")
if !executor {
@@ -1121,13 +1124,15 @@ func (op *AgentOsOperator) installNFSOfflineExec() (bool, []string) {
"/root/install",
})
// install
AllCommandExecutor([]string{
"dpkg",
"-i",
"/root/install/tmp/nfs-client/*.deb",
"rm",
"-rf",
"/root/install/tmp",
})
// install
BasicPrettyPrint(HardCodeCommandExecutor("dpkg -i /root/install/tmp/nfs-client/*.deb"))
ok, resultLog = BasicSystemdUp("nfs")
if !ok {
return false, append(resultLog, "[installNFSOfflineExec] - start nfs-common.service failed !")