startws.sh
1.19 KB
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
#!/bin/bash
################################################################
#@Authro Lijian
#@Date 2007-05-25
################################################################
BASE_BIN_DIR=`dirname $0`
. $BASE_BIN_DIR/env.sh
HOST_NAME=`hostname`
JBOSS_CTL=$BASE_BIN_DIR/jbossctl.sh
TOMCAT_CTL=$BASE_BIN_DIR/tomcatctl.sh
## start jboss
start_jboss(){
echo -e "[INFO] $HOST_NAME: starting jboss ...\c"
chmod +x $BASE_BIN_DIR/jbossctl.sh
$JBOSS_CTL > $JBOSS_STDOUT_LOG 2>&1 &
COUNT=0
printProcess 5
while [ $COUNT -lt 1 ]; do
COUNT=`curl -s $CHECK_SERVER_STARTUP_URL |grep -c "$STARTUP_SUCCESS_MSG"`
printProcess 3
done
success "Oook!"
}
## start tomcat
start_tomcat(){
echo -e "[INFO] $HOST_NAME: starting tomcat ...\c"
chmod +x $BASE_BIN_DIR/tomcatctl.sh
$TOMCAT_CTL &
COUNT=0
printProcess 5
while [ $COUNT -lt 1 ]; do
COUNT=`curl -s $CHECK_SERVER_STARTUP_URL |grep -c "$STARTUP_SUCCESS_MSG"`
printProcess 3
done
success "Oook!"
}
if [ $SERVER_TYPE = "jboss" ]; then
start_jboss
fi
if [ $SERVER_TYPE = "tomcat" ]; then
start_tomcat
fi
success "[INFO] $HOSTNAME: startup web server done!"