Statistics
| Revision:

root / Portal / configurations / install.sh @ 3

History | View | Annotate | Download (3 kB)

1
#!/bin/bash
2

    
3
echo "** TXMWEB install: start."
4

    
5
# auth params
6
USER="$1"
7
PASSWORD="$2"
8
URL="$3"
9
# parameters
10
TOMCAT="$4"
11
SRCFILES="$5"
12
TXMWEBHOME="$6"
13
# application
14
WARPATH="$7"
15
APPNAME="$8"
16

    
17
MANAGERURL="http://$USER:$PASSWORD@$URL/manager/html/"
18

    
19
# check params
20
# Test $SRCFILES content
21
if [ ! -d "$SRCFILES/$APPNAME" ]; then
22
	echo "** TXMWEB install: $SRCFILES/$APPNAME is missing"
23
	exit 1;
24
fi
25

    
26
if [ ! -d "$SRCFILES/$APPNAME/biblio" ]; then
27
	echo "** TXMWEB install: $SRCFILES/$APPNAME/biblio is missing. This folder contains the bibliographic records of texts"
28
	exit 1;
29
fi
30

    
31
if [ ! -d "$SRCFILES/$APPNAME/css" ]; then
32
	echo "** TXMWEB install: $SRCFILES/$APPNAME/css is missing. This folder contains the css files"
33
	exit 1;
34
fi
35

    
36
if [ ! -d "$SRCFILES/$APPNAME/html" ]; then
37
	echo "** TXMWEB install: $SRCFILES/$APPNAME/html is missing. This folder contains the HTML files"
38
	exit 1;
39
fi
40

    
41
if [ ! -d "$SRCFILES/$APPNAME/images" ]; then
42
	echo "** TXMWEB install: $SRCFILES/$APPNAME/images is missing. This folder contains the png, jpg, ... files"
43
	exit 1;
44
fi
45

    
46
if [ ! -d "$SRCFILES/$APPNAME/jsp" ]; then
47
	echo "** TXMWEB install: $SRCFILES/$APPNAME/jsp is missing. This folder contains the jsp files. Such as 404.jsp"
48
	exit 1;
49
fi
50

    
51
if [ ! -d "$SRCFILES/$APPNAME/data" ]; then
52
	echo "** TXMWEB install: $SRCFILES/$APPNAME/data is missing. This folder contains the data to launch TXMWEB itself."
53
	exit 1;
54
fi
55

    
56
if [ ! -d "$SRCFILES/$APPNAME/data/users" ]; then
57
	echo "** TXMWEB install: $SRCFILES/$APPNAME/data/users is missing. This folder contains the serialized users as XML files."
58
	exit 1;
59
fi
60

    
61
if [ ! -d "$SRCFILES/$APPNAME/data/profiles" ]; then
62
	echo "** TXMWEB install: $SRCFILES/$APPNAME/data/profiles is missing. This folder contains the serialized profiles as XML files."
63
	exit 1;
64
fi
65

    
66
if [ ! -d "$SRCFILES/$APPNAME/data/mails" ]; then
67
	echo "** TXMWEB install: $SRCFILES/$APPNAME/data/mails is missing. This folder contains the mails templates."
68
	exit 1;
69
fi
70

    
71
# test conf files
72
if [ ! -f "$SRCFILES/$APPNAME/txmweb.conf" ]; then
73
	echo "** TXMWEB install: $SRCFILES/$APPNAME/txmweb.conf file is missing. It describes the parameters of TXMWEB"
74
	exit 1;
75
fi
76

    
77
if [ ! -f "$SRCFILES/$APPNAME/textometrie.properties" ]; then
78
	echo "** TXMWEB install: $SRCFILES/$APPNAME/textometrie.properties file is missing. It describes the parameters of the Toolbox"
79
	exit 1;
80
fi
81

    
82
# creating dirs
83
# Try to create $TXMWEBHOME
84
mkdir "$TXMWEBHOME"
85
if [ ! -d "$TXMWEBHOME" ]; then
86
	echo "** TXMWEB install: src txmwebhome could not been created $TXMWEBHOME. Can't continue the installation."
87
	exit 1;
88
fi
89

    
90
# Try to create $TXMWEBHOME APP DIR
91
mkdir "$TXMWEBHOME/$APPNAME"
92
if [ ! -d "$TXMWEBHOME/$APPNAME" ]; then
93
	echo "** TXMWEB install: src txmwebhome could not been created $TXMWEBHOME/$APPNAME. Can't continue the installation."
94
	exit 1;
95
fi
96

    
97
# copy REPO files in home of $APPNAME
98
cp -rf "$SRCFILES/$APPNAME" "$TXMWEBHOME"
99

    
100
if [ $? != 0 ]; then
101
	echo "** TXMWEB install: Failed to copy files from repository $TXMWEBHOME/$APPNAME to TXMWEBHOME $TXMWEBHOME. Aborting."
102
	exit 1;
103
fi
104

    
105
# the end
106
echo "** TXMWEB install: done."