-
Notifications
You must be signed in to change notification settings - Fork 356
/
goquiet_prepare.sh
53 lines (49 loc) · 1.5 KB
/
goquiet_prepare.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
get_input_domain(){
while true
do
_read "请输入重定向域名 (默认: cloudfront.com):"
domain="${inputInfo}"
[ -z "$domain" ] && domain="cloudfront.com"
if ! judge_is_domain "${domain}"; then
_echo -e "请输入一个格式正确的域名."
continue
fi
if ! judge_is_valid_domain "${domain}"; then
_echo -e "无法解析到IP,请输入一个正确有效的域名."
continue
fi
_echo -r " ServerName = ${domain}"
break
done
}
get_input_webaddr(){
while true
do
_read "请输入与重定向域名对应的IP (默认: ${domain_ip}:443):"
gqwebaddr="${inputInfo}"
[ -z "$gqwebaddr" ] && gqwebaddr="${domain_ip}:443"
if ! judge_is_ip_colon_port_format "${gqwebaddr}"; then
_echo -e "请输入正确合法的IP:443组合."
continue
fi
_echo -r " WebServerAddr = ${gqwebaddr}"
break
done
}
get_input_gqkey(){
gen_random_str
_read "请输入密钥 (默认: ${ran_str12}):"
gqkey="${inputInfo}"
[ -z "$gqkey" ] && gqkey=${ran_str12}
_echo -r " Key = ${gqkey}"
}
install_prepare_libev_goquiet(){
improt_package "utils" "common_prepare.sh"
get_input_inbound_port 443
firewallNeedOpenPort="${INBOUND_PORT}"
shadowsocksport="${firewallNeedOpenPort}"
kill_process_if_port_occupy "${firewallNeedOpenPort}"
get_input_domain
get_input_webaddr
get_input_gqkey
}