From 87394f3ee6c7f605f3da3611a567795783addaab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=AC=E5=93=A5=E4=BE=83=E4=BE=83=E4=BE=83ygkkk?= <121604513+yonggekkk@users.noreply.github.com> Date: Mon, 27 Jan 2025 13:14:24 +0800 Subject: [PATCH] Update serv00.sh --- serv00.sh | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 4 deletions(-) diff --git a/serv00.sh b/serv00.sh index 4b33a5a..fda358c 100644 --- a/serv00.sh +++ b/serv00.sh @@ -307,7 +307,9 @@ nb=$(hostname | cut -d '.' -f 1 | tr -d 's') if [ "$nb" == "14" ]; then ytb='"jnn-pa.googleapis.com",' fi - +hy1p=$(sed -n '1p' hy2ip.txt) +hy2p=$(sed -n '2p' hy2ip.txt) +hy3p=$(sed -n '3p' hy2ip.txt) cat > config.json << EOF { "log": { @@ -319,6 +321,69 @@ fi { "tag": "hysteria-in", "type": "hysteria2", + "listen": "$hy1p", + "listen_port": $hy2_port, + "users": [ + { + "password": "$UUID" + } + ], + "masquerade": "https://www.bing.com", + "ignore_client_bandwidth":false, + "tls": { + "enabled": true, + "alpn": [ + "h3" + ], + "certificate_path": "cert.pem", + "key_path": "private.key" + } + }, + { + "tag": "hysteria-in", + "type": "hysteria2", + "listen": "$hy2p", + "listen_port": $hy2_port, + "users": [ + { + "password": "$UUID" + } + ], + "masquerade": "https://www.bing.com", + "ignore_client_bandwidth":false, + "tls": { + "enabled": true, + "alpn": [ + "h3" + ], + "certificate_path": "cert.pem", + "key_path": "private.key" + } + }, + { + "tag": "hysteria-in", + "type": "hysteria2", + "listen": "$hy3p", + "listen_port": $hy2_port, + "users": [ + { + "password": "$UUID" + } + ], + "masquerade": "https://www.bing.com", + "ignore_client_bandwidth":false, + "tls": { + "enabled": true, + "alpn": [ + "h3" + ], + "certificate_path": "cert.pem", + "key_path": "private.key" + } + }, + { + "tag": "hysteria-in", + "type": "hysteria2", "listen": "$IP", "listen_port": $hy2_port, "users": [ @@ -1197,16 +1262,18 @@ menu() { echo "============================================================" nb=$(echo "$HOSTNAME" | cut -d '.' -f 1 | tr -d 's') ym=("$HOSTNAME" "cache$nb.serv00.com" "web$nb.serv00.com") -rm -rf $WORKDIR/ip.txt +rm -rf $WORKDIR/ip.txt $WORKDIR/hy2ip.txt +for ip in "${ym[@]}"; do +dig @8.8.8.8 +time=2 +short $ip >> $WORKDIR/hy2ip.txt +sleep 1 +done for ym in "${ym[@]}"; do -# 引用frankiejun API response=$(curl -sL --connect-timeout 5 --max-time 7 "https://ss.botai.us.kg/api/getip?host=$ym") if [[ -z "$response" || "$response" == *unknown* ]]; then for ip in "${ym[@]}"; do dig @8.8.8.8 +time=2 +short $ip >> $WORKDIR/ip.txt sleep 1 done -break else echo "$response" | while IFS='|' read -r ip status; do if [[ $status == "Accessible" ]]; then