forked from jaspeen/oracle-11g
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pavlobornia
committed
Aug 6, 2019
1 parent
6fc8ab7
commit a661716
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
set -e | ||
source /assets/colorecho | ||
source ~/.bashrc | ||
|
||
### RUN USER DEFINED SCRIPTS AND PATCHES | ||
SCRIPTS_ROOT="/opt/init"; | ||
|
||
# Check whether parameter has been passed on | ||
if [ -z "$SCRIPTS_ROOT" ]; then | ||
echo_yellow "$0: No SCRIPTS_ROOT passed on, no scripts will be run"; | ||
exit 1; | ||
fi; | ||
|
||
# Execute custom provided files (only if directory exists and has files in it) | ||
if [ -d "$SCRIPTS_ROOT" ] && [ -n "$(ls -A $SCRIPTS_ROOT)" ]; then | ||
|
||
echo ""; | ||
echo_green "Executing user defined scripts" | ||
|
||
for f in $SCRIPTS_ROOT/*; do | ||
case "$f" in | ||
*.sh) echo_green "$0: running $f"; . "$f" ;; | ||
*.sql) echo_green "$0: running $f"; echo "exit" | $ORACLE_HOME/bin/sqlplus -s "/ as sysdba" @"$f"; echo ;; | ||
*) echo_yellow "$0: ignoring $f" ;; | ||
esac | ||
echo ""; | ||
done | ||
|
||
echo_green "DONE: Executing user defined scripts" | ||
echo ""; | ||
|
||
fi; |