Update serv00keep.sh

This commit is contained in:
甬哥侃侃侃ygkkk
2025-03-01 11:32:21 +08:00
committed by GitHub
parent 4e53852695
commit caa1ca4aad
+17 -11
View File
@@ -255,14 +255,9 @@ echo "${public_key}" > public_key.txt
fi
private_key=$(<private_key.txt)
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')
if [[ "$nb" =~ (14|15|16) ]]; 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)
@@ -275,7 +270,7 @@ hy3p=$(sed -n '3p' hy2ip.txt)
},
"inbounds": [
{
"tag": "hysteria-in",
"tag": "hysteria-in1",
"type": "hysteria2",
"listen": "$hy1p",
"listen_port": $hy2_port,
@@ -296,7 +291,7 @@ hy3p=$(sed -n '3p' hy2ip.txt)
}
},
{
"tag": "hysteria-in",
"tag": "hysteria-in2",
"type": "hysteria2",
"listen": "$hy2p",
"listen_port": $hy2_port,
@@ -317,7 +312,7 @@ hy3p=$(sed -n '3p' hy2ip.txt)
}
},
{
"tag": "hysteria-in",
"tag": "hysteria-in3",
"type": "hysteria2",
"listen": "$hy3p",
"listen_port": $hy2_port,
@@ -414,16 +409,20 @@ hy3p=$(sed -n '3p' hy2ip.txt)
"download_detour": "direct"
}
],
EOF
if [[ "$nb" =~ (14|15|16) ]]; then
cat >> config.json <<EOF
"rules": [
{
"domain": [
$ytb
"oh.my.god"
"jnn-pa.googleapis.com"
],
"outbound": "wg"
},
{
"rule_set":"google-gemini",
"rule_set":[
"google-gemini"
],
"outbound": "wg"
}
],
@@ -431,6 +430,13 @@ hy3p=$(sed -n '3p' hy2ip.txt)
}
}
EOF
else
cat >> config.json <<EOF
"final": "direct"
}
}
EOF
fi
if ! ps aux | grep '[r]un -c con' > /dev/null; then
ps aux | grep '[r]un -c con' | awk '{print $2}' | xargs -r kill -9 > /dev/null 2>&1