diff options
author | danielhanrahan <daniel.hanrahan@est.tech> | 2022-10-25 16:14:16 +0100 |
---|---|---|
committer | danielhanrahan <daniel.hanrahan@est.tech> | 2022-10-26 16:31:57 +0100 |
commit | 2e80c5de293bcd24b36c88eacb4d862a17435c26 (patch) | |
tree | 5123efc3312fe02490333f3a0a819179e55f2352 /packages/apex-pdp-package-full/src/main | |
parent | 84f095f4b5a6329a8568c50d997b926d86bf18ab (diff) |
Make apex-pdp dockerfile consistent
Make apex dockerfile consistent with other PF dockerfiles:
Change apexuser to policy user
Remove duplicate copy of examples directory
Issue-ID: POLICY-4411
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: Iee7560cf3263d13d38cd829af9b0389cbc256f49
Diffstat (limited to 'packages/apex-pdp-package-full/src/main')
-rwxr-xr-x | packages/apex-pdp-package-full/src/main/package/scripts/apexAsh.sh | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/apexAsh.sh b/packages/apex-pdp-package-full/src/main/package/scripts/apexAsh.sh index 60608f922..0b7b25afb 100755 --- a/packages/apex-pdp-package-full/src/main/package/scripts/apexAsh.sh +++ b/packages/apex-pdp-package-full/src/main/package/scripts/apexAsh.sh @@ -2,7 +2,7 @@ #------------------------------------------------------------------------------- # ============LICENSE_START======================================================= -# Copyright (C) 2016-2018 Ericsson. All rights reserved. +# Copyright (C) 2016-2022 Ericsson. All rights reserved. # Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,12 +21,28 @@ # ============LICENSE_END========================================================= #------------------------------------------------------------------------------- -# Run from the Apex home directory -if [ ! -d /home/apexuser ]; then - echo Apex user home directory "/home/apexuser" not found - exit +if [ -z $APEX_HOME ]; then + APEX_HOME="/opt/app/policy/apex-pdp" +fi + +if [ ! -d $APEX_HOME ]; then + echo + echo 'Apex directory "'$APEX_HOME'" not set or not a directory' + echo "Please set environment for 'APEX_HOME'" + exit +fi + +if [ -z "$APEX_USER" ]; then + APEX_USER="apexuser" +fi + +id $APEX_USER > /dev/null 2>& 1 +if [ "$?" != "0" ]; then + echo 'cannot run apex, user "'$APEX_USER'" does not exit' + exit fi +# Run from the Apex home directory +cd $APEX_HOME # Run the command as "apexuser" -cd /home/apexuser -su apexuser +su $APEX_USER |