-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
127 lines (99 loc) · 2.76 KB
/
install.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#! /bin/sh
#======================================================================#
# System Required: CentOS 7 or Higher #
# GB28181+ZLMediaKit服务 一键安装与启动脚本 #
# Author:zhangkai <[email protected]> #
#======================================================================#
root=/home/wvp
# Check command is exist
check_command(){
local command=$1
if hash $command 2> /dev/null; then
return 1
else
return 0
fi
}
if check_command wget; then
yum -y install wget
fi
if check_command gcc; then
yum -y install gcc gcc-c++
yum -y install pcre-devel openssl openssl-devel
fi
# CMake complie by source
if check_command cmake; then
if [[ ! -e "cmake-3.3.2.tar.gz" ]];then
cd ${root}
wget https://cmake.org/files/v3.3/cmake-3.3.2.tar.gz
tar -xvf cmake-3.3.2.tar.gz
fi
cd cmake-3.3.2
./configure
make -j4
make install
fi
yum -y install epel-release
yum -y update
# Redis install by yum source
if check_command redis-cli; then
yum -y install redis
systemctl start redis
systemctl enable redis
fi
if check_command ffmpeg; then
sudo rpm -v --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
sudo yum install ffmpeg ffmpeg-devel
fi
# ZLMediaKit complie by source
cd ${root}
git clone --depth 1 https://gitee.com/xia-chu/ZLMediaKit
if [[ -d ZLMediaKit ]];then
cd ZLMediaKit
git submodule update --init
cd ZLMediaKit
mkdir build
cd build
cmake ..
make -j4
fi
# wvp complie by source
if check_command java; then
yum -y install java
fi
if check_command git; then
yum -y install git
fi
if check_command maven; then
yum -y install maven
fi
if check_command node; then
curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
yum -y install nodejs
npm --registry=https://registry.npm.taobao.org install -g pm2
fi
cd ${root}
git clone https://gitee.com/pan648540858/wvp-GB28181-pro.git
if [[ -d wvp-GB28181-pro ]];then
cd wvp-GB28181-pro/web_src/
npm --registry=https://registry.npm.taobao.org install
npm run build
cd ..
mvn package
wvpjar="target/wvp-pro.jar"
if [[ -e ${wvpjar} ]];then
rm -f ${wvpjar}
fi
mv target/*.jar ${wvpjar}
fi
cd ${root}
if [[ -d ZLMediaKit ]];then
mkdir -p ${root}/ZLMediaKit/release/linux/Debug/www/record
cp -f zlm.ini ${root}/ZLMediaKit/release/linux/Debug/config.ini
pm2 start zlm.sh
fi
if [[ -d wvp-GB28181-pro ]];then
cp -f wvp-pro.yml ${root}/wvp-GB28181-pro/target/application.yml
pm2 start wvp-pro.sh
fi