Skip to content

Commit c53fb92

Browse files
committed
use properties instead of hard-coded values
Signed-off-by: Jianguo Ma <[email protected]>
1 parent f0d0a86 commit c53fb92

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/main/scripts/configure-ihs.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,20 @@ EOF
4040
systemctl enable "$srvName"
4141
}
4242

43+
# Get IHS installation properties
44+
source /datadrive/virtualimage.properties
45+
4346
# Check whether the user is entitled or not
44-
while [ ! -f "/var/log/cloud-init-was.log" ]
47+
while [ ! -f "$WAS_LOG_PATH" ]
4548
do
4649
sleep 5
4750
done
4851

4952
isDone=false
5053
while [ $isDone = false ]
5154
do
52-
result=`(tail -n1) </var/log/cloud-init-was.log`
53-
if [[ $result = Entitled ]] || [[ $result = Unentitled ]] || [[ $result = Undefined ]]; then
55+
result=`(tail -n1) <$WAS_LOG_PATH`
56+
if [[ $result = $ENTITLED ]] || [[ $result = $UNENTITLED ]] || [[ $result = $UNDEFINED ]]; then
5457
isDone=true
5558
else
5659
sleep 5
@@ -61,8 +64,8 @@ done
6164
cloud-init clean --logs
6265

6366
# Terminate the process for the un-entitled or undefined user
64-
if [ ${result} != Entitled ]; then
65-
if [ ${result} = Unentitled ]; then
67+
if [ ${result} != $ENTITLED ]; then
68+
if [ ${result} = $UNENTITLED ]; then
6669
echo "The provided IBM ID does not have entitlement to install WebSphere Application Server. Please contact the primary or secondary contacts for your IBM Passport Advantage site to grant you access or follow steps at IBM eCustomer Care (https://ibm.biz/IBMidEntitlement) for further assistance."
6770
else
6871
echo "No WebSphere Application Server installation packages were found. This is likely due to a temporary issue with the installation repository. Try again and open an IBM Support issue if the problem persists."
@@ -87,9 +90,6 @@ mountpointPath=$8
8790

8891
echo "$(date): Start to configure IHS."
8992

90-
# Get IHS installation properties
91-
source /datadrive/virtualimage.properties
92-
9393
# Open ports
9494
firewall-cmd --zone=public --add-port=80/tcp --permanent
9595
firewall-cmd --zone=public --add-port=8008/tcp --permanent

src/main/scripts/install.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,17 +215,20 @@ create_custom_profile() {
215215
echo "$(date): Custom profile created."
216216
}
217217

218+
# Get tWAS installation properties
219+
source /datadrive/virtualimage.properties
220+
218221
# Check whether the user is entitled or not
219-
while [ ! -f "/var/log/cloud-init-was.log" ]
222+
while [ ! -f "$WAS_LOG_PATH" ]
220223
do
221224
sleep 5
222225
done
223226

224227
isDone=false
225228
while [ $isDone = false ]
226229
do
227-
result=`(tail -n1) </var/log/cloud-init-was.log`
228-
if [[ $result = Entitled ]] || [[ $result = Unentitled ]] || [[ $result = Undefined ]]; then
230+
result=`(tail -n1) <$WAS_LOG_PATH`
231+
if [[ $result = $ENTITLED ]] || [[ $result = $UNENTITLED ]] || [[ $result = $UNDEFINED ]]; then
229232
isDone=true
230233
else
231234
sleep 5
@@ -236,8 +239,8 @@ done
236239
cloud-init clean --logs
237240

238241
# Terminate the process for the un-entitled or undefined user
239-
if [ ${result} != Entitled ]; then
240-
if [ ${result} = Unentitled ]; then
242+
if [ ${result} != $ENTITLED ]; then
243+
if [ ${result} = $UNENTITLED ]; then
241244
echo "The provided IBM ID does not have entitlement to install WebSphere Application Server. Please contact the primary or secondary contacts for your IBM Passport Advantage site to grant you access or follow steps at IBM eCustomer Care (https://ibm.biz/IBMidEntitlement) for further assistance."
242245
else
243246
echo "No WebSphere Application Server installation packages were found. This is likely due to a temporary issue with the installation repository. Try again and open an IBM Support issue if the problem persists."
@@ -267,9 +270,6 @@ storageAccountKey=$9
267270
fileShareName=${10}
268271
mountpointPath=${11}
269272

270-
# Get tWAS installation properties
271-
source /datadrive/virtualimage.properties
272-
273273
# Create cluster by creating deployment manager, node agent & add nodes to be managed
274274
if [ "$dmgr" = True ]; then
275275
create_dmgr_profile Dmgr001 $(hostname) Dmgr001Node Dmgr001NodeCell "$adminUserName" "$adminPassword"

0 commit comments

Comments
 (0)