This repository was archived by the owner on May 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcompile_test.sh
More file actions
executable file
·103 lines (95 loc) · 1.67 KB
/
compile_test.sh
File metadata and controls
executable file
·103 lines (95 loc) · 1.67 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
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
#!/bin/bash
cwd=$(pwd)
check_beta(){
local check=$(ls "$cwd/beta")
if [ check == "$cwd/beta" ]
then
return 1
fi
return 0
}
copy_www(){
cp -r "$cwd/wwwroot" "../SoftEtherVPN/src/bin/hamcore/"
}
recompile(){
if [ $? == "1" ]
then
cd "../SoftEtherVPN"
#git submodule init git submodule update
#./configure
make -C build
else
cd "../SoftEtherVPN"
#./configure
make
# make install
fi
}
case $1 in
"stable")
git clone "https://github.com/SoftEtherVPN/SoftEtherVPN_Stable.git" ../SoftEtherVPN
cd "../SoftEtherVPN"
./configure
make
# make install
cd -
copy_www
recompile
;;
"beta")
git clone "https://github.com/SoftEtherVPN/SoftEtherVPN.git" ../SoftEtherVPN
touch "$cwd/beta"
cd "../SoftEtherVPN"
git submodule init && git submodule update
./configure
make -C build
# make -C build install
cd -
copy_www
recompile
;;
"edit")
check_beta
cd "../SoftEtherVPN"
if [ $? == "1" ]
then
sudo ./"build/vpnserver" "stop"
else
sudo ./"bin/vpnserver/vpnserver" "stop"
fi
cd $cwd
cd "wwwroot/admin/default/"
dir=$(pwd)
ls_dir=$(ls "$dir" | grep "node_modules")
if [ "$ls_dir" != "" ]
then
npm run build
cd -
copy_www
recompile
cd "../SoftEtherVPN"
if [ $? == "1" ]
then
sudo ./"build/vpnserver" "start"
else
sudo ./"bin/vpnserver/vpnserver" "start"
fi
else
npm i
npm run build
cd -
copy_www
recompile
cd "../SoftEtherVPN"
if [ $? == "1" ]
then
sudo ./"build/vpnserver" "start"
else
sudo ./"bin/vpnserver/vpnserver" "start"
fi
fi
;;
*)
echo "usage: $0 <stable|beta|edit>"
;;
esac