function.sh
899 Bytes
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
#!/bin/bash
################################################################
#@Authro Lijian
#@Date 2007-08-09
################################################################
PROJECT_TARGET=$2.zip
WEB_APP_HOME=$1/$2/deploy
#app install
install(){
if [ -d $WEB_APP_HOME ]; then
sh $WEB_APP_HOME/bin/killws.sh
echo "[INFO] rm -rf $WEB_APP_HOME"
rm -rf $WEB_APP_HOME
fi
echo "[INFO] mkdir $WEB_APP_HOME"
mkdir $WEB_APP_HOME
echo "[INFO] unzip -q $WEB_APP_HOME/../$PROJECT_TARGET -d $WEB_APP_HOME"
unzip -q $WEB_APP_HOME/../$PROJECT_TARGET -d $WEB_APP_HOME
}
#app startup
startup(){
sh $WEB_APP_HOME/bin/startws.sh
}
#app links
links(){
echo "[INFO] ln -s ..."
if [ -d $WEB_APP_HOME/htdocs ]; then
ln -s /data/upload $WEB_APP_HOME/htdocs/upload
fi
#if [ -d $WEB_APP_HOME/htdocs ]; then
#ln -s $WEB_APP_HOME/logs $WEB_APP_HOME/htdocs/logs
#fi
}
install
startup
links