Skip to content

Commit 2e72135

Browse files
Added IP to dummy host mapping (#3004)
* fixed permission matching logic * fixed permission matching logic * fixed permission matching logic * fixed permission matching logic * updated PAR URL * Added to support handling of stuck podman container * fixed lint * Update agentAutoUpdate.sh * Update agentAutoUpdate.sh * Update agentAutoUpdate.sh * Fixed handling of force removal of stuck podman containers in stopping state * Fixed handling of force removal of stuck podman containers in stopping state * Added Peoplesoft views definitions * Added Peoplesoft views definitions, updated readme and created versions * Added Peoplesoft views definitions, updated readme and created versions * Added fix to remove the child processed before terminating the parent process * Added fix to remove the child processed before terminating the parent process * updated PSFT views * Added required SQLs for day N data load for PeopleSoft * Added manager in PSFT Data View * Added User Management Update Set XML for Service Now User Management * Added ORDS application script for APEX * Added ORDS application script for APEX * Added IP to dummy host mapping * shellcheck
1 parent 33376e2 commit 2e72135

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

OracleIdentityGovernance/samples/scripts/agentManagement.sh

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,22 @@ loadImage(){
255255
runAgent(){
256256
groupId=$(id -g)
257257
. "$ENV_FILE"
258+
hostAddressMap=$(getProperty idoConfig.hostAddressMap)
259+
host_prefix="--add-host "
260+
addHost=$(echo "$hostAddressMap" | awk -F ";" -v prefix="$host_prefix" -v OFS=" " '{
261+
for (i=1; i<=NF; i++) {
262+
$i = prefix $i
263+
}
264+
print
265+
}')
258266
if [ "$containerRuntime" = "docker" ]
259267
then
260268
if [ ! "$(docker ps -a -f "name=$AI" --format '{{.Names}}')" ]
261269
then
262270
echo "INFO: Starting new container."
263271
if [ -f "$CONFDIR"/config.properties ]; then
264-
docker run -d --env-file "$CONFDIR"/config.properties -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
272+
# shellcheck disable=SC2086
273+
docker run -d --env-file "$CONFDIR"/config.properties $addHost -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
265274
else
266275
docker run -d -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
267276
fi
@@ -309,7 +318,8 @@ runAgent(){
309318
then
310319
echo "INFO: Starting new container."
311320
if [ -f "$CONFDIR"/config.properties ]; then
312-
podman run -d --user root --env-file "$CONFDIR"/config.properties -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
321+
# shellcheck disable=SC2086
322+
podman run -d --user root --env-file "$CONFDIR"/config.properties $addHost -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
313323
else
314324
podman run -d --user root -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
315325
fi
@@ -720,7 +730,7 @@ if [ -n "${CONTAINER_ID}" ]; then
720730

721731
# shellcheck disable=SC2046
722732
kill -9 $(list_descendants ${CONTAINER_PROCESS_ID})
723-
733+
724734
# Kill any processes containing the process ID.
725735
# This kills the child processes too.
726736
# shellcheck disable=SC2046
@@ -743,9 +753,9 @@ if [ -n "${CONTAINER_ID}" ]; then
743753
CONTAINER_PROCESS_ID=$(ps -ef | grep -v grep | grep "$CONTAINER_ID" | awk '{print $2}')
744754
echo Container Process ID: ${CONTAINER_PROCESS_ID}
745755

746-
# shellcheck disable=SC2046
747-
kill -9 $(list_descendants ${CONTAINER_PROCESS_ID})
748-
756+
# shellcheck disable=SC2046
757+
kill -9 $(list_descendants ${CONTAINER_PROCESS_ID})
758+
749759
# Kill any processes containing the process ID.
750760
# This kills the child processes too.
751761
# shellcheck disable=SC2046
@@ -1167,4 +1177,4 @@ while [ $# -gt 0 ]; do
11671177
* ) echo "ERROR: agentManagement: Invalid option: \"$opt\"" >&2
11681178
exit 1;;
11691179
esac
1170-
done
1180+
done

0 commit comments

Comments
 (0)