fix: dpkg omc pkg issue
This commit is contained in:
@@ -698,8 +698,8 @@ func ActiveSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
runCmd := fmt.Sprintf("sudo %s/actpkg.sh '%s'",
|
||||
config.GetYamlConfig().NE.ScpDir, filePath)
|
||||
runCmd := fmt.Sprintf("sudo %s/actpkg.sh '%s' %s",
|
||||
config.GetYamlConfig().NE.ScpDir, filePath, neTypeUpper)
|
||||
if neTypeLower == "omc" {
|
||||
idNeVersion, _ := strconv.Atoi((*neVersion)[0]["id"])
|
||||
neVersionData := dborm.NeVersion{
|
||||
@@ -712,7 +712,7 @@ func ActiveSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
||||
services.ResponseInternalServerError500ProcessError(w, err)
|
||||
return
|
||||
}
|
||||
log.Debug("Run here")
|
||||
|
||||
services.ResponseStatusOK204NoContent(w)
|
||||
go RunSSHCmd(sshHost, runCmd)
|
||||
return
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
filename="$1"
|
||||
neType="$2"
|
||||
extension=$(basename "${1}" | awk -F . '{print $NF}')
|
||||
|
||||
case "${extension}" in
|
||||
deb)
|
||||
if [ neType == "OMC" ]; then
|
||||
systemctl stop restagent.service
|
||||
fi
|
||||
expect <<EOF
|
||||
spawn dpkg -i --force-all "$filename"
|
||||
set timeout 180
|
||||
@@ -14,6 +18,9 @@ case "${extension}" in
|
||||
EOF
|
||||
;;
|
||||
rpm)
|
||||
if [ neType == "OMC" ]; then
|
||||
systemctl stop restagent.service
|
||||
fi
|
||||
expect <<EOF
|
||||
spawn rpm -Uvh "$filename"
|
||||
set timeout 180
|
||||
|
||||
Reference in New Issue
Block a user