更新 trojan.sh
This commit is contained in:
43
trojan.sh
43
trojan.sh
@@ -118,39 +118,6 @@ EOF
|
||||
rm -f trojan-${latest_version}-linux-amd64.tar.xz
|
||||
green "请设置trojan密码, 建议不要出现特殊字符"
|
||||
read -p "请输入密码 :" trojan_passwd
|
||||
cat > /usr/src/trojan-cli/config.json <<-EOF
|
||||
{
|
||||
"run_type": "client",
|
||||
"local_addr": "127.0.0.1",
|
||||
"local_port": 1080,
|
||||
"remote_addr": "$your_domain",
|
||||
"remote_port": 443,
|
||||
"password": [
|
||||
"$trojan_passwd"
|
||||
],
|
||||
"log_level": 1,
|
||||
"ssl": {
|
||||
"verify": true,
|
||||
"verify_hostname": true,
|
||||
"cert": "",
|
||||
"cipher_tls13":"TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
|
||||
"sni": "",
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"reuse_session": true,
|
||||
"session_ticket": false,
|
||||
"curves": ""
|
||||
},
|
||||
"tcp": {
|
||||
"no_delay": true,
|
||||
"keep_alive": true,
|
||||
"fast_open": false,
|
||||
"fast_open_qlen": 20
|
||||
}
|
||||
}
|
||||
EOF
|
||||
rm -rf /usr/src/trojan/server.conf
|
||||
cat > /usr/src/trojan/server.conf <<-EOF
|
||||
{
|
||||
@@ -195,7 +162,6 @@ EOF
|
||||
}
|
||||
}
|
||||
EOF
|
||||
cd /usr/src/trojan-cli/
|
||||
rm -rf /usr/src/trojan-temp/
|
||||
trojan_path=$(cat /dev/urandom | head -1 | md5sum | head -c 16)
|
||||
#mkdir /usr/share/nginx/html/${trojan_path}
|
||||
@@ -219,7 +185,7 @@ EOF
|
||||
chmod +x ${systempwd}trojan.service
|
||||
systemctl enable trojan.service
|
||||
cd /root
|
||||
cat > /usr/src/trojan-cert/$your_domain/private.key<<-EOF
|
||||
cat > /usr/src/trojan-cert/${your_domain}/private.key<<-EOF
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDFgyVU/fGMnGRj
|
||||
Re5GUAipHJ03EMtbvcJkb//97AvZ8ZbgGLAplMaFLPNnT07DkCWv3073V5RHyBbZ
|
||||
@@ -250,7 +216,7 @@ Pw4j4HYa1hsLalNhkohZ0g==
|
||||
-----END PRIVATE KEY-----
|
||||
EOF
|
||||
|
||||
cat > /usr/src/trojan-cert/$your_domain/fullchain.cer<<-EOF
|
||||
cat > /usr/src/trojan-cert/${your_domain}/fullchain.cer<<-EOF
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEyjCCArKgAwIBAgIQTwN47Aj6/rIK5WCAN+orWTANBgkqhkiG9w0BAQsFADCB
|
||||
jzELMAkGA1UEBhMCQ04xEzARBgNVBAgMCkdyZWF0Q2hpbmExDjAMBgNVBAcMBUxv
|
||||
@@ -280,10 +246,6 @@ IOTFcQhop8TB7s0tH0zLmk/ykU+E5IRbWQsGH15bUAwoCRTLu9uv1YMO0MhUMfMs
|
||||
A4LKG7+qOm+5egiZDomeaM472wyc/OK3jNR9uYMv
|
||||
-----END CERTIFICATE-----
|
||||
EOF
|
||||
green " 客户端配置文件"
|
||||
green "==========================================================================="
|
||||
cat /usr/src/trojan-cli/config.json
|
||||
green "==========================================================================="
|
||||
port_forward
|
||||
}
|
||||
function preinstall_check(){
|
||||
@@ -414,7 +376,6 @@ function remove_trojan(){
|
||||
find / | grep nginx | sudo xargs rm -rf
|
||||
fi
|
||||
rm -rf /usr/src/trojan/
|
||||
rm -rf /usr/src/trojan-cli/
|
||||
rm -rf /usr/src/trojan-cert/
|
||||
rm -rf /usr/share/nginx/html/*
|
||||
rm -rf /etc/nginx/
|
||||
|
||||
Reference in New Issue
Block a user