8.3.1.7 Editing the MainCreateTargetOS.sh shell script
The following script file is created:
cd /root/ECMContainers/Container-PIT
The script as follows is inserted in the MainCreateTargetOS.sh file:
# Licensed Materials – Property of IBM
# (c) Copyright IBM Corp.
2017, 2018 All Rights Reserved.
basepath=$(cd
‘
dirname $0
‘
; pwd)
ScriptsDir=
“
$basepath/install-scripts
“
# read and execute commands from ./setproperties.sh and return.
# create status.log keeps track of the script completion or non-completion
filename=$ScriptsDir/
“
status.log
“
echo
“
deployDB2_OS2DB: NotCompleted
“
>> $filename
echo
“
createP8OS2: NotCompleted
“
>> $filename
echo
“
deployDB2_OS2DB: NotCompleted
“
>> $filename
echo
“
createP8OS2: NotCompleted
“
>> $filename
source $ScriptsDir/getLicenseApproval.sh
source $ScriptsDir/gatherHostInfo.sh
source $ScriptsDir/getCredential.sh
# Check status of script and only execute if it is NotCompleted
if grep -q
“
deployDB2_OS2DB: Completed
“
$filename; then
echo
“
Skipping deployDB2_OS2DB.sh, as it was completed during previous execution!
“
echo
“
deployDB2_OS2DB.sh was not run before, running now!
“
source $ScriptsDir/deployDB2_OS2DB.sh
if grep -q
“
createP8OS2: Completed
“
$filename; then
echo
“
Skipping createP8OS2.sh, as it was completed during previous execution!
“
echo
“
createP8OS2.sh was not run before, running now!
“
source $ScriptsDir/createP8OS2.sh
duration_0=$((($end_time_0-$start_time_0)/60))
echo
“
This execution took $duration_0 minutes
“
Change the script file security:
chmod 775 MainCreateTargetOS.sh
Run the script file to create the
DB2
database and WebSphere Datasources:
cd /root/ECMContainers/Container-PIT
./MainCreateTargetOS.sh The new object store was successfully created as shown in Figure 8.40:
Figure 8.40: The OS2DB Object Store database is successfully created
The reboot command must be used to establish the update database configuration in the docker containers: