forked from berlin493/github4shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_dnscrypt-proxy.sh
63 lines (48 loc) · 1.28 KB
/
install_dnscrypt-proxy.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
#!/bin/bash
#SET ENV
YUM_SERVER='yum.server.local'
PACKAGE_URL="http://${YUM_SERVER}/tools"
#SET TEMP PATH
TEMP_PATH='/usr/local/src'
#SET TEMP DIR
INSTALL_DIR="install_$$"
INSTALL_PATH="${TEMP_PATH}/${INSTALL_DIR}"
#SET PACKAGE
YUM_PACKAGE='gcc glibc glibc-common make cmake gcc-c++'
APT_PACKAGE='build-essential'
#SET EXIT STATUS AND COMMAND
trap "exit 1" HUP INT PIPE QUIT TERM
trap "rm -rf ${INSTALL_PATH}" EXIT
download_func () {
local func_shell='func4install.sh'
local func_url="http://${YUM_SERVER}/shell/${func_shell}"
local tmp_file="/tmp/${func_shell}"
wget -q ${func_url} -O ${tmp_file} && source ${tmp_file} ||\
eval "echo Can not access ${func_url}! 1>&2;exit 1"
rm -f ${tmp_file}
}
main () {
#DOWNLOAD FUNC FOR INSTALL
download_func
#CHECK SYSTEM AND CREATE TEMP DIR
check_system
#create_tmp_dir
set_install_cmd 'lan'
#Install libsodium-0.4.5.tar.gz
PACKAGE='libsodium-0.4.5.tar.gz'
create_tmp_dir
download_and_check
run_cmds './configure' 'make' 'make install'
#CHECK SYSTEM AND CREATE TEMP DIR
check_system
#create_tmp_dir
set_install_cmd 'lan'
#Install libsodium-0.4.5.tar.gz
PACKAGE='dnscrypt-proxy-1.3.3.tar.gz'
create_tmp_dir
download_and_check
run_cmds './configure --prefix=/usr --host=arm' 'make' 'make install'
#EXIT AND CLEAR TEMP DIR
exit_and_clear
}
main