forked from clarkja/ci.docker.websphere-classic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
createProfileAndStartServer.sh
executable file
·68 lines (59 loc) · 2.18 KB
/
createProfileAndStartServer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
#####################################################################################
# #
# Script to create AppServer profile and start the server #
# #
# Usage : createProfileAndStartServer.sh #
# #
#####################################################################################
#Check whether profile name is provided or use default
if [ "$PROFILE_NAME" = "" ]
then
PROFILE_NAME="AppSrv01"
fi
#Check whether cell name is provided or use default
if [ "$CELL_NAME" = "" ]
then
CELL_NAME="DefaultCell01"
fi
#Check whether node name is provided or use default
if [ "$NODE_NAME" = "" ]
then
NODE_NAME="DefaultNode01"
fi
#Check whether host name is provided or use default
if [ "$HOST_NAME" = "" ]
then
HOST_NAME="localhost"
fi
#if profile is already created just start the server
if [ -d /opt/IBM/WebSphere/AppServer/profiles/$PROFILE_NAME/logs/server1 ]
then
echo "Starting server ....................."
/opt/IBM/WebSphere/AppServer/profiles/$PROFILE_NAME/bin/startServer.sh server1
else
echo "Creating profile ...................."
/opt/IBM/WebSphere/AppServer/bin/manageprofiles.sh -create -profileName $PROFILE_NAME \
-profilePath /opt/IBM/WebSphere/AppServer/profiles/$PROFILE_NAME \
-templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/default \
-nodeName $NODE_NAME -cellName $CELL_NAME -hostName $HOST_NAME
if [ $? = 0 ]
then
echo "Starting server ..................."
/opt/IBM/WebSphere/AppServer/profiles/$PROFILE_NAME/bin/startServer.sh server1
else
echo " Profile creation failed , exiting ........"
exit 1
fi
fi
if [ $? != 0 ]
then
echo " AppServer startup failed , exiting......"
exit 1
fi
sleep 10
#Check the existence of server process
while [ -f "/opt/IBM/WebSphere/AppServer/profiles/$PROFILE_NAME/logs/server1/server1.pid" ]
do
sleep 5
done