From d98e0f0115d3b1c6d9f70a7974ab3788aec359c1 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: Sun, 2 Mar 2025 12:39:43 +0800 Subject: [PATCH] Update serv00.sh --- serv00.sh | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/serv00.sh b/serv00.sh index 9c7a396..820482f 100644 --- a/serv00.sh +++ b/serv00.sh @@ -338,9 +338,9 @@ echo "${public_key}" > public_key.txt openssl ecparam -genkey -name prime256v1 -out "private.key" openssl req -new -x509 -days 3650 -key "private.key" -out "cert.pem" -subj "/CN=$USERNAME.serv00.net" nb=$(hostname | cut -d '.' -f 1 | tr -d 's') -hy1p=$(sed -n '1p' hy2ip.txt) -hy2p=$(sed -n '2p' hy2ip.txt) -hy3p=$(sed -n '3p' hy2ip.txt) +#hy1p=$(sed -n '1p' hy2ip.txt) +#hy2p=$(sed -n '2p' hy2ip.txt) +#hy3p=$(sed -n '3p' hy2ip.txt) cat > config.json << EOF { "log": { @@ -352,7 +352,7 @@ hy3p=$(sed -n '3p' hy2ip.txt) { "tag": "hysteria-in1", "type": "hysteria2", - "listen": "$hy1p", + "listen": "$(dig @8.8.8.8 +time=5 +short "web$nb.serv00.com")", "listen_port": $hy2_port, "users": [ { @@ -373,7 +373,7 @@ hy3p=$(sed -n '3p' hy2ip.txt) { "tag": "hysteria-in2", "type": "hysteria2", - "listen": "$hy2p", + "listen": "$(dig @8.8.8.8 +time=5 +short "$HOSTNAME")", "listen_port": $hy2_port, "users": [ { @@ -394,7 +394,7 @@ hy3p=$(sed -n '3p' hy2ip.txt) { "tag": "hysteria-in3", "type": "hysteria2", - "listen": "$hy3p", + "listen": "$(dig @8.8.8.8 +time=5 +short "cache$nb.serv00.com")", "listen_port": $hy2_port, "users": [ { @@ -1356,12 +1356,9 @@ menu() { 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 $WORKDIR/hy2ip.txt -dig @8.8.8.8 +time=5 +short "web$nb.serv00.com" >> $WORKDIR/hy2ip.txt -sleep 2 -dig @8.8.8.8 +time=5 +short "$HOSTNAME" >> $WORKDIR/hy2ip.txt -sleep 2 -dig @8.8.8.8 +time=5 +short "cache$nb.serv00.com" >> $WORKDIR/hy2ip.txt -sleep 2 +#dig @8.8.8.8 +time=5 +short "web$nb.serv00.com" >> $WORKDIR/hy2ip.txt +#dig @8.8.8.8 +time=5 +short "$HOSTNAME" >> $WORKDIR/hy2ip.txt +#dig @8.8.8.8 +time=5 +short "cache$nb.serv00.com" >> $WORKDIR/hy2ip.txt for host in "${ym[@]}"; do response=$(curl -sL --connect-timeout 5 --max-time 7 "https://ss.fkj.pp.ua/api/getip?host=$host") if [[ "$response" =~ ^$|unknown|not|error ]]; then