Skip to content

Commit 5f3d589

Browse files
authored
Oracle Management Agent support Arm64 install bundle and bugfixes (#2918)
* Oracle Management Agent support Arm64 install bundle and bugfixes Signed-off-by: Drupad Panchal <[email protected]> * Oracle Management Agent - set exec bit for scripts Signed-off-by: Drupad Panchal <[email protected]> --------- Signed-off-by: Drupad Panchal <[email protected]>
1 parent f269a7b commit 5f3d589

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

OracleManagementAgent/dockerfiles/latest/container-scripts/common.sh

+16-11
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,15 @@ function _expandVar()
3838
# Returns: 0 if first version gte second, otherwise 1
3939
function version_greater_than()
4040
{
41-
local date1=${1%%.*} time1=${1##*.}
42-
local date2=${2%%.*} time2=${2##*.}
41+
local first="" second=""
42+
first=$(trim "$1")
43+
if [[ -z "$first" ]]; then
44+
return 1
45+
fi
46+
second=$(trim "$2")
47+
48+
local date1=${first%%.*} time1=${first##*.}
49+
local date2=${second%%.*} time2=${second##*.}
4350

4451
if [ "$date1" -gt "$date2" ]; then
4552
return 0
@@ -70,7 +77,7 @@ function version_parse()
7077
{
7178
local var=$1
7279
if [ "${var}" == "${CONTAINER_INSTALL_BUNDLE}" ]; then
73-
var=$(unzip -l "${var}" | grep -Po 'oracle.mgmt_agent-\d{6}.\d{4}.linux.zip')
80+
var=$(unzip -l "${var}" | grep -Po 'oracle.mgmt_agent-\d{6}.\d{4}.linux.*.zip')
7481
fi
7582
var=${var##*/}
7683
var=${var#"${var%%[[:digit:]]*}"}
@@ -86,17 +93,15 @@ function version_parse()
8693
# Returns: 0 if execution is successful, 1 otherwise
8794
function execute_cmd()
8895
{
89-
local cmd="$1"
90-
local operation="$2"
96+
local cmd="$1" operation="$2" output="" status=-1
9197
log "Executing ($operation): $cmd"
92-
eval "$cmd"
93-
94-
local cmd_exit_code=$?
95-
if [ $cmd_exit_code -eq 0 ]; then
96-
log "$APPNAME $operation successful [status: $cmd_exit_code]"
98+
output="$(eval "$cmd" 2>&1)"
99+
status=$?
100+
if [ $status -eq 0 ]; then
101+
log "$APPNAME $operation successful [status: $status, output: $output]"
97102
return 0
98103
else
99-
log "$APPNAME $operation failed [status: $cmd_exit_code]"
104+
log "$APPNAME $operation failed [status: $status, output: $output]"
100105
return 1
101106
fi
102107
}

OracleManagementAgent/dockerfiles/latest/container-scripts/watchdog.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ INSTALL_BASEDIR=$PACKAGES/mgmt_agent
1919
UPGRADE_STAGE=$BOOTSTRAP_HOME/upgrade
2020
CONFIG_FILE="$BASE_DIR/mgmtagent_secret/input.rsp"
2121
MGMTAGENT_HOME="$BASE_DIR/mgmt_agent"
22-
AUTOUPGRADE_BUNDLE="$MGMTAGENT_HOME/zip/oracle.mgmt_agent-??????.????.linux.zip"
22+
AUTOUPGRADE_BUNDLE="$MGMTAGENT_HOME/zip/oracle.mgmt_agent-??????.????.linux*.zip"
2323
CONTAINER_INSTALL_BUNDLE=$PACKAGES/oracle.mgmt_agent.zip
2424
LOGS_DIR="$BOOTSTRAP_HOME/logs"
2525
# shellcheck disable=SC2034

0 commit comments

Comments
 (0)