@@ -126,48 +126,22 @@ function setup_deployment_directories() {
126
126
127
127
# #
128
128
# # r u n _ u s e r _ s c r i p t s
129
- # #
130
- # # Hook for launching custom scripts in the container before and after ogg start
131
- # # Default Values:
132
- # # - ${OGG_DEPLOYMENT_SCRIPTS} : "${OGG_HOME}/scripts"
133
- # #
134
- # # Scripts are run lexicographically and recursively from the directories pointed to by:
135
- # # - ${OGG_DEPLOYMENT_SCRIPTS}/setup are executed prior to any other steps in the boot sequence
136
- # # - ${OGG_DEPLOYMENT_SCRIPTS}/startup are executed after ogg/nginx startup
129
+ # # Run custom scripts in the container before and after GoldenGate starts
137
130
# #
138
131
function run_user_scripts {
139
-
140
- local SCRIPTS_ROOT=" ${1} " ;
141
-
142
- [ -z " $SCRIPTS_ROOT " ] && {
143
- printf " %s: No SCRIPTS_ROOT passed on, no scripts will be run\n" " ${0} " ;
144
- return 1;
145
- } || {
146
- if [ -d " $SCRIPTS_ROOT " ] && [ -n " $( ls -A " $SCRIPTS_ROOT " ) " ]; then
147
- printf " Executing user defined scripts in: %s\n" " ${SCRIPTS_ROOT} "
148
-
149
- for f in " ${SCRIPTS_ROOT} " /* ; do
150
- [ -d " ${f} " ] && {
151
- run_user_scripts " ${f} "
152
- } || {
153
- case " $f " in
154
- * .sh)
155
- printf " %s: running %s\n" " ${0} " " ${f} " ;
156
- source " $f " && state=$? || state=$?
157
- ;;
158
- * )
159
- printf " %s: ignoring %s\n" " ${0} " " ${f} " && state=$? || state=$?
160
- ;;
161
- esac
162
- echo " " ;
163
- }
164
- done
165
- echo " DONE: Executing user defined scripts"
166
- echo " " ;
167
- fi
168
- }
169
-
170
- return 0
132
+ local scripts=" ${1} " ;
133
+ while read -r script; do
134
+ case " ${script} " in
135
+ * .sh)
136
+ echo " Running script '${script} '"
137
+ # shellcheck disable=SC1090
138
+ source " ${script} "
139
+ ;;
140
+ * )
141
+ echo " Ignoring '${script} '"
142
+ ;;
143
+ esac
144
+ done < <( find " ${scripts} " -type f | sort)
171
145
}
172
146
173
147
# #
@@ -218,8 +192,8 @@ function signal_handling() {
218
192
# #
219
193
# # Entrypoint
220
194
# #
221
- run_user_scripts " ${OGG_DEPLOYMENT_SCRIPTS} /setup"
222
195
generatePassword
196
+ run_user_scripts " ${OGG_DEPLOYMENT_SCRIPTS} /setup"
223
197
setup_deployment_directories
224
198
locate_java
225
199
locate_lib_jvm
0 commit comments