-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathinstall_x86_64.sh
75 lines (59 loc) · 1.9 KB
/
install_x86_64.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
69
70
71
72
73
74
75
#install.sh
#jetty https://www.eclipse.org/jetty/download.html
#jre http://www.oracle.com/technetwork/java/javase/downloads/index.html
jetty="http://dependency.newcrawler.com/jetty/jetty-distribution-9.4.27.v20200227.tar.gz"
jre="http://dependency.newcrawler.com/jre/jre-8u241-linux-x64.tar.gz"
yum -y install tar git wget
git clone https://github.com/speed/newcrawler.git ~/newcrawler
if [ ! -f "newcrawler/war/index.html" ]; then
echo "newcrawler is not installed!"
exit 0
fi
cd newcrawler
#jetty
if [ ! -f "jetty/bin/jetty.sh" ]; then
rm -Rivf ./jetty
wget --no-check-certificate $jetty -O jetty.tar.gz
mkdir ./jetty && tar -xzvf jetty.tar.gz -C ./jetty --strip-components 1
if [ ! -f "jetty/bin/jetty.sh" ]; then
echo "Jetty is not installed!"
exit 0
fi
fi
#jre
if [ ! -f "jre/bin/java" ]; then
rm -Rivf ./jre
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" $jre -O server-jre-linux.tar.gz
mkdir ./jre && tar -xzvf server-jre-linux.tar.gz -C ./jre --strip-components 1
chmod +rwx ./jre -R
if [ ! -f "jre/bin/java" ]; then
echo "JAVA is not installed!"
exit 0
fi
fi
#PhantomJs
#yum -y install bzip2
#yum -y install fontconfig freetype libfreetype.so.6 libfontconfig.so.1
#Script and Config
rm -f -v start.sh
wget --no-check-certificate https://raw.githubusercontent.com/speed/newcrawler/master/config/newcrawler.xml -P jetty/webapps/ -O jetty/webapps/newcrawler.xml
if [ ! -f "start.sh" ]; then
echo "'start.sh' is not installed!"
exit 0
fi
if [ ! -f "stop.sh" ]; then
echo "'stop.sh' is not installed!"
exit 0
fi
if [ ! -f "jetty/webapps/newcrawler.xml" ]; then
echo "'newcrawler.xml' is not installed!"
exit 0
fi
#Remove install package
rm -f -v start-docker.sh
rm -f -v jetty.tar.gz
rm -f -v server-jre-linux.tar.gz
rm -f -v install_*.sh
rm -f -v Dockerfile
jre/bin/java -version
echo 'Congratulations, the installation is successful.'