Update serv00.sh

This commit is contained in:
甬哥侃侃侃ygkkk
2025-01-27 13:14:24 +08:00
committed by GitHub
parent 50d66067f3
commit 87394f3ee6
+71 -4
View File
@@ -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