@@ -11,10 +11,14 @@ purple() { echo -e "\e[1;35m$1\033[0m"; }
|
||||
reading() { read -p "$(red "$1")" "$2"; }
|
||||
USERNAME=$(whoami | tr '[:upper:]' '[:lower:]')
|
||||
HOSTNAME=$(hostname)
|
||||
WORKDIR="${HOME}/domains/${USERNAME}.serv00.net/logs"
|
||||
snb=$(hostname | awk -F '.' '{print $1}')
|
||||
nb=$(hostname | cut -d '.' -f 1 | tr -d 's')
|
||||
devil www add ${USERNAME}.serv00.net php > /dev/null 2>&1
|
||||
FILE_PATH="${HOME}/domains/${USERNAME}.serv00.net/public_html"
|
||||
WORKDIR="${HOME}/domains/${USERNAME}.serv00.net/logs"
|
||||
keep_path="${HOME}/domains/${snb}.${USERNAME}.serv00.net/public_nodejs"
|
||||
[ -d "$FILE_PATH" ] || mkdir -p "$FILE_PATH"
|
||||
[ -d "$keep_path" ] || mkdir -p "$keep_path"
|
||||
[ -d "$WORKDIR" ] || (mkdir -p "$WORKDIR" && chmod 777 "$WORKDIR")
|
||||
curl -sk "http://${snb}.${USERNAME}.serv00.net/up" > /dev/null 2>&1
|
||||
devil binexec on >/dev/null 2>&1
|
||||
@@ -69,9 +73,9 @@ done <<< "$portlist"
|
||||
fi
|
||||
check_port
|
||||
if [[ -e $WORKDIR/config.json ]]; then
|
||||
hyp=$(jq -r '.inbounds[0].listen_port' $WORKDIR/config.json 2>/dev/null)
|
||||
vlp=$(jq -r '.inbounds[3].listen_port' $WORKDIR/config.json 2>/dev/null)
|
||||
vmp=$(jq -r '.inbounds[4].listen_port' $WORKDIR/config.json 2>/dev/null)
|
||||
hyp=$(jq -r '.inbounds[0].listen_port' $WORKDIR/config.json)
|
||||
vlp=$(jq -r '.inbounds[3].listen_port' $WORKDIR/config.json)
|
||||
vmp=$(jq -r '.inbounds[4].listen_port' $WORKDIR/config.json)
|
||||
purple "检测到Serv00-sb-yg脚本已安装,执行端口替换,请稍等……"
|
||||
sed -i '' "12s/$hyp/$hy2_port/g" $WORKDIR/config.json
|
||||
sed -i '' "33s/$hyp/$hy2_port/g" $WORKDIR/config.json
|
||||
@@ -82,9 +86,9 @@ sed -i '' -e "17s|'$vlp'|'$vless_port'|" serv00keep.sh
|
||||
sed -i '' -e "18s|'$vmp'|'$vmess_port'|" serv00keep.sh
|
||||
sed -i '' -e "19s|'$hyp'|'$hy2_port'|" serv00keep.sh
|
||||
bash -c 'ps aux | grep $(whoami) | grep -v "sshd\|bash\|grep" | awk "{print \$2}" | xargs -r kill -9 >/dev/null 2>&1' >/dev/null 2>&1
|
||||
sleep 2
|
||||
sleep 1
|
||||
curl -sk "http://${snb}.${USERNAME}.serv00.net/up" > /dev/null 2>&1
|
||||
sleep 3
|
||||
sleep 5
|
||||
green "端口替换完成!"
|
||||
ps aux | grep '[r]un -c con' > /dev/null && green "主进程启动成功,单节点用户修改下客户端三协议端口,订阅链接用户更新下订阅即可" || yellow "Sing-box主进程启动失败,再次重置端口或者多刷几次保活网页,可能会自动恢复"
|
||||
if [ -f "$WORKDIR/boot.log" ]; then
|
||||
@@ -273,35 +277,12 @@ argo_configure() {
|
||||
fi
|
||||
break
|
||||
done
|
||||
|
||||
if [[ $ARGO_AUTH =~ TunnelSecret ]]; then
|
||||
echo $ARGO_AUTH > tunnel.json
|
||||
cat > tunnel.yml << EOF
|
||||
tunnel: $(cut -d\" -f12 <<< "$ARGO_AUTH")
|
||||
credentials-file: tunnel.json
|
||||
protocol: http2
|
||||
|
||||
ingress:
|
||||
- hostname: $ARGO_DOMAIN
|
||||
service: http://localhost:$vmess_port
|
||||
originRequest:
|
||||
noTLSVerify: true
|
||||
- service: http_status:404
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
# Download Dependency Files
|
||||
download_and_run_singbox() {
|
||||
ARCH=$(uname -m) && DOWNLOAD_DIR="." && mkdir -p "$DOWNLOAD_DIR" && FILE_INFO=()
|
||||
if [ "$ARCH" == "arm" ] || [ "$ARCH" == "arm64" ] || [ "$ARCH" == "aarch64" ]; then
|
||||
FILE_INFO=("https://github.com/eooce/test/releases/download/arm64/sb web" "https://github.com/eooce/test/releases/download/arm64/bot13 bot")
|
||||
elif [ "$ARCH" == "amd64" ] || [ "$ARCH" == "x86_64" ] || [ "$ARCH" == "x86" ]; then
|
||||
FILE_INFO=("https://github.com/yonggekkk/Cloudflare_vless_trojan/releases/download/serv00/sb web" "https://github.com/yonggekkk/Cloudflare_vless_trojan/releases/download/serv00/server bot")
|
||||
else
|
||||
echo "Unsupported architecture: $ARCH"
|
||||
exit 1
|
||||
fi
|
||||
DOWNLOAD_DIR="." && mkdir -p "$DOWNLOAD_DIR" && FILE_INFO=()
|
||||
FILE_INFO=("https://github.com/yonggekkk/Cloudflare_vless_trojan/releases/download/serv00/sb web" "https://github.com/yonggekkk/Cloudflare_vless_trojan/releases/download/serv00/server bot")
|
||||
declare -A FILE_MAP
|
||||
generate_random_name() {
|
||||
local chars=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
|
||||
@@ -355,17 +336,8 @@ private_key=$(echo "${output}" | awk '/PrivateKey:/ {print $2}')
|
||||
public_key=$(echo "${output}" | awk '/PublicKey:/ {print $2}')
|
||||
echo "${private_key}" > private_key.txt
|
||||
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')
|
||||
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)
|
||||
cat > config.json << EOF
|
||||
{
|
||||
"log": {
|
||||
@@ -375,9 +347,9 @@ hy3p=$(sed -n '3p' hy2ip.txt)
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"tag": "hysteria-in",
|
||||
"tag": "hysteria-in1",
|
||||
"type": "hysteria2",
|
||||
"listen": "$hy1p",
|
||||
"listen": "$(dig @8.8.8.8 +time=5 +short "web$nb.serv00.com" | sort -u)",
|
||||
"listen_port": $hy2_port,
|
||||
"users": [
|
||||
{
|
||||
@@ -396,9 +368,9 @@ hy3p=$(sed -n '3p' hy2ip.txt)
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "hysteria-in",
|
||||
"tag": "hysteria-in2",
|
||||
"type": "hysteria2",
|
||||
"listen": "$hy2p",
|
||||
"listen": "$(dig @8.8.8.8 +time=5 +short "$HOSTNAME" | sort -u)",
|
||||
"listen_port": $hy2_port,
|
||||
"users": [
|
||||
{
|
||||
@@ -417,9 +389,9 @@ hy3p=$(sed -n '3p' hy2ip.txt)
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "hysteria-in",
|
||||
"tag": "hysteria-in3",
|
||||
"type": "hysteria2",
|
||||
"listen": "$hy3p",
|
||||
"listen": "$(dig @8.8.8.8 +time=5 +short "cache$nb.serv00.com" | sort -u)",
|
||||
"listen_port": $hy2_port,
|
||||
"users": [
|
||||
{
|
||||
@@ -481,7 +453,7 @@ hy3p=$(sed -n '3p' hy2ip.txt)
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "wireguard",
|
||||
"tag": "wg",
|
||||
@@ -514,23 +486,34 @@ 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"
|
||||
}
|
||||
}
|
||||
],
|
||||
"final": "direct"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
else
|
||||
cat >> config.json <<EOF
|
||||
"final": "direct"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [ -e "$(basename "${FILE_MAP[web]}")" ]; then
|
||||
echo "$(basename "${FILE_MAP[web]}")" > sb.txt
|
||||
@@ -562,8 +545,6 @@ if [ -e "$(basename "${FILE_MAP[bot]}")" ]; then
|
||||
if [[ $ARGO_AUTH =~ ^[A-Z0-9a-z=]{120,250}$ ]]; then
|
||||
#args="tunnel --edge-ip-version auto --no-autoupdate --protocol http2 run --token ${ARGO_AUTH}"
|
||||
args="tunnel --no-autoupdate run --token ${ARGO_AUTH}"
|
||||
elif [[ $ARGO_AUTH =~ TunnelSecret ]]; then
|
||||
args="tunnel --edge-ip-version auto --config tunnel.yml run"
|
||||
else
|
||||
#args="tunnel --edge-ip-version auto --no-autoupdate --protocol http2 --logfile boot.log --loglevel info --url http://localhost:$vmess_port"
|
||||
args="tunnel --url http://localhost:$vmess_port --no-autoupdate --logfile boot.log --loglevel info"
|
||||
@@ -1108,22 +1089,21 @@ rules:
|
||||
EOF
|
||||
|
||||
sleep 2
|
||||
[ -d "$FILE_PATH" ] || mkdir -p "$FILE_PATH"
|
||||
v2sub=$(cat jh.txt)
|
||||
echo "$v2sub" > ${FILE_PATH}/${UUID}_v2sub.txt
|
||||
cat clash_meta.yaml > ${FILE_PATH}/${UUID}_clashmeta.txt
|
||||
cat sing_box.json > ${FILE_PATH}/${UUID}_singbox.txt
|
||||
curl -sL https://raw.githubusercontent.com/yonggekkk/sing-box-yg/main/index.html -o "$FILE_PATH"/index.html
|
||||
V2rayN_LINK="https://${USERNAME}.serv00.net/${UUID}_v2sub.txt"
|
||||
Clashmeta_LINK="https://${USERNAME}.serv00.net/${UUID}_clashmeta.txt"
|
||||
Singbox_LINK="https://${USERNAME}.serv00.net/${UUID}_singbox.txt"
|
||||
allip=$(cat hy2ip.txt)
|
||||
cat > list.txt <<EOF
|
||||
=================================================================================================
|
||||
|
||||
当前客户端正在使用的IP:$IP
|
||||
如默认节点IP被墙,可在客户端地址更换以下其他IP
|
||||
$allip
|
||||
$(dig @8.8.8.8 +time=5 +short "web$nb.serv00.com" | sort -u)
|
||||
$(dig @8.8.8.8 +time=5 +short "$HOSTNAME" | sort -u)
|
||||
$(dig @8.8.8.8 +time=5 +short "cache$nb.serv00.com" | sort -u)
|
||||
-------------------------------------------------------------------------------------------------
|
||||
|
||||
一、Vless-reality分享链接如下:
|
||||
@@ -1227,7 +1207,6 @@ fi
|
||||
}
|
||||
|
||||
servkeep() {
|
||||
curl -sSL https://raw.githubusercontent.com/yonggekkk/sing-box-yg/main/serv00keep.sh -o serv00keep.sh && chmod +x serv00keep.sh
|
||||
sed -i '' -e "14s|''|'$UUID'|" serv00keep.sh
|
||||
sed -i '' -e "17s|''|'$vless_port'|" serv00keep.sh
|
||||
sed -i '' -e "18s|''|'$vmess_port'|" serv00keep.sh
|
||||
@@ -1262,13 +1241,6 @@ chmod +x webport.sh
|
||||
#green "安装完毕,默认每10分钟执行一次,运行 crontab -e 可自行修改保活执行间隔" && sleep 2
|
||||
#echo
|
||||
green "开始安装多功能主页,请稍等……"
|
||||
keep_path="$HOME/domains/${snb}.${USERNAME}.serv00.net/public_nodejs"
|
||||
[ -d "$keep_path" ] || mkdir -p "$keep_path"
|
||||
curl -sL https://raw.githubusercontent.com/yonggekkk/sing-box-yg/main/app.js -o "$keep_path"/app.js
|
||||
sed -i '' "15s/name/$snb/g" "$keep_path"/app.js
|
||||
sed -i '' "60s/key/$UUID/g" "$keep_path"/app.js
|
||||
sed -i '' "75s/name/$USERNAME/g" "$keep_path"/app.js
|
||||
sed -i '' "75s/where/$snb/g" "$keep_path"/app.js
|
||||
devil www del ${snb}.${USERNAME}.serv00.net > /dev/null 2>&1
|
||||
devil www add ${USERNAME}.serv00.net php > /dev/null 2>&1
|
||||
devil www add ${snb}.${USERNAME}.serv00.net nodejs /usr/local/bin/node18 > /dev/null 2>&1
|
||||
@@ -1318,10 +1290,17 @@ if [[ -e $WORKDIR/config.json ]]; then
|
||||
echo "export PATH=\"\$HOME/bin:\$PATH\"" >> "$HOME/.bashrc"
|
||||
source "$HOME/.bashrc"
|
||||
fi
|
||||
curl -sL https://raw.githubusercontent.com/yonggekkk/sing-box-yg/main/sversion | awk -F "更新内容" '{print $1}' | head -n 1 > $WORKDIR/v
|
||||
else
|
||||
red "未安装脚本,请选择1进行安装" && exit
|
||||
fi
|
||||
curl -sL https://raw.githubusercontent.com/yonggekkk/sing-box-yg/main/app.js -o "$keep_path"/app.js
|
||||
sed -i '' "15s/name/$snb/g" "$keep_path"/app.js
|
||||
sed -i '' "60s/key/$UUID/g" "$keep_path"/app.js
|
||||
sed -i '' "75s/name/$USERNAME/g" "$keep_path"/app.js
|
||||
sed -i '' "75s/where/$snb/g" "$keep_path"/app.js
|
||||
curl -sSL https://raw.githubusercontent.com/yonggekkk/sing-box-yg/main/serv00keep.sh -o serv00keep.sh && chmod +x serv00keep.sh
|
||||
curl -sL https://raw.githubusercontent.com/yonggekkk/sing-box-yg/main/index.html -o "$FILE_PATH"/index.html
|
||||
curl -sL https://raw.githubusercontent.com/yonggekkk/sing-box-yg/main/sversion | awk -F "更新内容" '{print $1}' | head -n 1 > $WORKDIR/v
|
||||
else
|
||||
red "未安装脚本,请选择1进行安装" && exit
|
||||
fi
|
||||
}
|
||||
|
||||
resservsb(){
|
||||
@@ -1372,27 +1351,24 @@ menu() {
|
||||
echo "------------------------------------------------------------"
|
||||
red "0. 退出脚本"
|
||||
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 $WORKDIR/hy2ip.txt
|
||||
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
|
||||
rm -rf ip.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
|
||||
dig @8.8.8.8 +time=5 +short $host >> $WORKDIR/ip.txt
|
||||
sleep 1
|
||||
dig @8.8.8.8 +time=5 +short $host | sort -u >> $WORKDIR/ip.txt
|
||||
sleep 1
|
||||
else
|
||||
echo "$response" | while IFS='|' read -r ip status; do
|
||||
while IFS='|' read -r ip status; do
|
||||
if [[ $status == "Accessible" ]]; then
|
||||
echo "$ip: 可用" >> $WORKDIR/ip.txt
|
||||
echo "$ip: 可用" >> $WORKDIR/ip.txt
|
||||
else
|
||||
echo "$ip: 被墙 (Argo与CDN回源节点、proxyip依旧有效)" >> $WORKDIR/ip.txt
|
||||
echo "$ip: 被墙 (Argo与CDN回源节点、proxyip依旧有效)" >> $WORKDIR/ip.txt
|
||||
fi
|
||||
done
|
||||
done <<< "$response"
|
||||
fi
|
||||
done
|
||||
sort -u $WORKDIR/ip.txt -o $WORKDIR/ip.txt
|
||||
green "Serv00服务器名称:${snb}"
|
||||
echo
|
||||
green "当前可选择的IP如下:"
|
||||
@@ -1420,29 +1396,31 @@ echo -e "检测到最新 Serv00-sb-yg 脚本版本号:${yellow}${latestV}${re}
|
||||
echo -e "${yellow}$(curl -sL https://raw.githubusercontent.com/yonggekkk/sing-box-yg/main/sversion)${re}"
|
||||
fi
|
||||
echo -e "========================================================="
|
||||
sbb=$(cat $WORKDIR/sb.txt 2>/dev/null)
|
||||
agg=$(cat $WORKDIR/ag.txt 2>/dev/null)
|
||||
showuuid=$(jq -r '.inbounds[0].users[0].password' $WORKDIR/config.json 2>/dev/null)
|
||||
if ps aux | grep '[r]un -c con' > /dev/null; then
|
||||
if ps aux | grep "$sbb" > /dev/null; then
|
||||
green "Sing-box主进程运行正常"
|
||||
green "UUID密码:$showuuid"
|
||||
else
|
||||
yellow "Sing-box主进程启动失败,请检测节点是否可用"
|
||||
fi
|
||||
if [ -f "$WORKDIR/boot.log" ] && grep -q "trycloudflare.com" "$WORKDIR/boot.log" 2>/dev/null && ps aux | grep '[t]unnel --u' > /dev/null; then
|
||||
if [ -f "$WORKDIR/boot.log" ] && grep -q "trycloudflare.com" "$WORKDIR/boot.log" 2>/dev/null && ps aux | grep "$agg" > /dev/null; then
|
||||
argosl=$(cat "$WORKDIR/boot.log" 2>/dev/null | grep -a trycloudflare.com | awk 'NR==2{print}' | awk -F// '{print $2}' | awk '{print $1}')
|
||||
checkhttp=$(curl -o /dev/null -s -w "%{http_code}\n" "https://$argosl")
|
||||
[ "$checkhttp" -eq 404 ] && check="域名有效" || check="域名可能无效"
|
||||
green "Argo临时域名:$argosl $check"
|
||||
fi
|
||||
if [ -f "$WORKDIR/boot.log" ] && ! ps aux | grep '[t]unnel --u' > /dev/null; then
|
||||
if [ -f "$WORKDIR/boot.log" ] && ! ps aux | grep "$agg" > /dev/null; then
|
||||
yellow "Argo临时域名暂时不存在,保活过程中会自动恢复"
|
||||
fi
|
||||
if ps aux | grep '[t]unnel --n' > /dev/null; then
|
||||
if [ ! -f "$WORKDIR/boot.log" ] && ps aux | grep "$agg" > /dev/null; then
|
||||
argogd=$(cat $WORKDIR/gdym.log 2>/dev/null)
|
||||
checkhttp=$(curl --max-time 2 -o /dev/null -s -w "%{http_code}\n" "https://$argogd")
|
||||
[ "$checkhttp" -eq 404 ] && check="域名有效" || check="域名可能失效"
|
||||
green "Argo固定域名:$argogd $check"
|
||||
fi
|
||||
if [ ! -f "$WORKDIR/boot.log" ] && ! ps aux | grep '[t]unnel --n' > /dev/null; then
|
||||
if [ ! -f "$WORKDIR/boot.log" ] && ! ps aux | grep "$agg" > /dev/null; then
|
||||
yellow "Argo固定域名:$(cat $WORKDIR/gdym.log 2>/dev/null),启动失败"
|
||||
fi
|
||||
green "多功能主页如下(支持保活、重启、重置端口、节点查询)"
|
||||
|
||||
+37
-68
@@ -26,6 +26,7 @@ devil binexec on >/dev/null 2>&1
|
||||
USERNAME=$(whoami | tr '[:upper:]' '[:lower:]')
|
||||
HOSTNAME=$(hostname)
|
||||
snb=$(hostname | awk -F '.' '{print $1}')
|
||||
nb=$(hostname | cut -d '.' -f 1 | tr -d 's')
|
||||
if [[ "$reset" =~ ^[Yy]$ ]]; then
|
||||
#crontab -l | grep -v "serv00keep" >rmcron
|
||||
#crontab rmcron >/dev/null 2>&1
|
||||
@@ -45,30 +46,28 @@ sleep 2
|
||||
devil www add ${USERNAME}.serv00.net php > /dev/null 2>&1
|
||||
FILE_PATH="${HOME}/domains/${USERNAME}.serv00.net/public_html"
|
||||
WORKDIR="${HOME}/domains/${USERNAME}.serv00.net/logs"
|
||||
[ -d "$FILE_PATH" ] || mkdir -p "$FILE_PATH"
|
||||
[ -d "$WORKDIR" ] || (mkdir -p "$WORKDIR" && chmod 777 "$WORKDIR")
|
||||
|
||||
read_ip(){
|
||||
nb=$(echo "$HOSTNAME" | cut -d '.' -f 1 | tr -d 's')
|
||||
ym=("$HOSTNAME" "cache$nb.serv00.com" "web$nb.serv00.com")
|
||||
rm -rf ip.txt hy2ip.txt
|
||||
dig @8.8.8.8 +time=5 +short "web$nb.serv00.com" >> hy2ip.txt
|
||||
dig @8.8.8.8 +time=5 +short "$HOSTNAME" >> hy2ip.txt
|
||||
dig @8.8.8.8 +time=5 +short "cache$nb.serv00.com" >> hy2ip.txt
|
||||
rm -rf ip.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
|
||||
dig @8.8.8.8 +time=5 +short $host >> ip.txt
|
||||
dig @8.8.8.8 +time=5 +short $host | sort -u >> ip.txt
|
||||
sleep 1
|
||||
else
|
||||
echo "$response" | while IFS='|' read -r ip status; do
|
||||
while IFS='|' read -r ip status; do
|
||||
if [[ $status == "Accessible" ]]; then
|
||||
echo "$ip: 可用" >> ip.txt
|
||||
echo "$ip: 可用" >> ip.txt
|
||||
else
|
||||
echo "$ip: 被墙 (Argo与CDN回源节点、proxyip依旧有效)" >> ip.txt
|
||||
echo "$ip: 被墙 (Argo与CDN回源节点、proxyip依旧有效)" >> ip.txt
|
||||
fi
|
||||
done
|
||||
done <<< "$response"
|
||||
fi
|
||||
done
|
||||
sort -u ip.txt -o ip.txt
|
||||
if [[ -z "$IP" ]]; then
|
||||
IP=$(grep -m 1 "可用" ip.txt | awk -F ':' '{print $1}')
|
||||
if [ -z "$IP" ]; then
|
||||
@@ -101,25 +100,6 @@ okip(){
|
||||
echo "$IP"
|
||||
}
|
||||
|
||||
# Generating argo Config
|
||||
argo_configure() {
|
||||
if [[ $ARGO_AUTH =~ TunnelSecret ]]; then
|
||||
echo $ARGO_AUTH > tunnel.json
|
||||
cat > tunnel.yml << EOF
|
||||
tunnel: $(cut -d\" -f12 <<< "$ARGO_AUTH")
|
||||
credentials-file: tunnel.json
|
||||
protocol: http2
|
||||
|
||||
ingress:
|
||||
- hostname: $ARGO_DOMAIN
|
||||
service: http://localhost:$vmess_port
|
||||
originRequest:
|
||||
noTLSVerify: true
|
||||
- service: http_status:404
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
uuidport(){
|
||||
if [[ -z "$UUID" ]]; then
|
||||
if [ ! -e UUID.txt ]; then
|
||||
@@ -214,16 +194,8 @@ export hy2_port=$udp_port
|
||||
|
||||
download_and_run_singbox() {
|
||||
if [ ! -s sb.txt ] && [ ! -s ag.txt ]; then
|
||||
ARCH=$(uname -m) && DOWNLOAD_DIR="." && mkdir -p "$DOWNLOAD_DIR" && FILE_INFO=()
|
||||
if [ "$ARCH" == "arm" ] || [ "$ARCH" == "arm64" ] || [ "$ARCH" == "aarch64" ]; then
|
||||
FILE_INFO=("https://github.com/eooce/test/releases/download/arm64/sb web" "https://github.com/eooce/test/releases/download/arm64/bot13 bot")
|
||||
elif [ "$ARCH" == "amd64" ] || [ "$ARCH" == "x86_64" ] || [ "$ARCH" == "x86" ]; then
|
||||
FILE_INFO=("https://github.com/yonggekkk/Cloudflare_vless_trojan/releases/download/serv00/sb web" "https://github.com/yonggekkk/Cloudflare_vless_trojan/releases/download/serv00/server bot")
|
||||
else
|
||||
echo "Unsupported architecture: $ARCH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOWNLOAD_DIR="." && mkdir -p "$DOWNLOAD_DIR" && FILE_INFO=()
|
||||
FILE_INFO=("https://github.com/yonggekkk/Cloudflare_vless_trojan/releases/download/serv00/sb web" "https://github.com/yonggekkk/Cloudflare_vless_trojan/releases/download/serv00/server bot")
|
||||
declare -A FILE_MAP
|
||||
generate_random_name() {
|
||||
local chars=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
|
||||
@@ -282,17 +254,8 @@ 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)
|
||||
cat > config.json << EOF
|
||||
{
|
||||
"log": {
|
||||
@@ -302,9 +265,9 @@ hy3p=$(sed -n '3p' hy2ip.txt)
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"tag": "hysteria-in",
|
||||
"tag": "hysteria-in1",
|
||||
"type": "hysteria2",
|
||||
"listen": "$hy1p",
|
||||
"listen": "$(dig @8.8.8.8 +time=5 +short "web$nb.serv00.com" | sort -u)",
|
||||
"listen_port": $hy2_port,
|
||||
"users": [
|
||||
{
|
||||
@@ -323,9 +286,9 @@ hy3p=$(sed -n '3p' hy2ip.txt)
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "hysteria-in",
|
||||
"tag": "hysteria-in2",
|
||||
"type": "hysteria2",
|
||||
"listen": "$hy2p",
|
||||
"listen": "$(dig @8.8.8.8 +time=5 +short "$HOSTNAME" | sort -u)",
|
||||
"listen_port": $hy2_port,
|
||||
"users": [
|
||||
{
|
||||
@@ -344,9 +307,9 @@ hy3p=$(sed -n '3p' hy2ip.txt)
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "hysteria-in",
|
||||
"tag": "hysteria-in3",
|
||||
"type": "hysteria2",
|
||||
"listen": "$hy3p",
|
||||
"listen": "$(dig @8.8.8.8 +time=5 +short "cache$nb.serv00.com" | sort -u)",
|
||||
"listen_port": $hy2_port,
|
||||
"users": [
|
||||
{
|
||||
@@ -408,7 +371,7 @@ hy3p=$(sed -n '3p' hy2ip.txt)
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "wireguard",
|
||||
"tag": "wg",
|
||||
@@ -441,16 +404,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"
|
||||
}
|
||||
],
|
||||
@@ -458,6 +425,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
|
||||
@@ -500,8 +474,6 @@ if [ -e "$(basename "${FILE_MAP[bot]}")" ]; then
|
||||
if [[ $ARGO_AUTH =~ ^[A-Z0-9a-z=]{120,250}$ ]]; then
|
||||
#args="tunnel --edge-ip-version auto --no-autoupdate --protocol http2 run --token ${ARGO_AUTH}"
|
||||
args="tunnel --no-autoupdate run --token ${ARGO_AUTH}"
|
||||
elif [[ $ARGO_AUTH =~ TunnelSecret ]]; then
|
||||
args="tunnel --edge-ip-version auto --config tunnel.yml run"
|
||||
else
|
||||
#args="tunnel --edge-ip-version auto --no-autoupdate --protocol http2 --logfile boot.log --loglevel info --url http://localhost:$vmess_port"
|
||||
args="tunnel --url http://localhost:$vmess_port --no-autoupdate --logfile boot.log --loglevel info"
|
||||
@@ -522,8 +494,6 @@ else
|
||||
if [[ $ARGO_AUTH =~ ^[A-Z0-9a-z=]{120,250}$ ]]; then
|
||||
#args="tunnel --edge-ip-version auto --no-autoupdate --protocol http2 run --token ${ARGO_AUTH}"
|
||||
args="tunnel --no-autoupdate run --token ${ARGO_AUTH}"
|
||||
elif [[ $ARGO_AUTH =~ TunnelSecret ]]; then
|
||||
args="tunnel --edge-ip-version auto --config tunnel.yml run"
|
||||
else
|
||||
#args="tunnel --edge-ip-version auto --no-autoupdate --protocol http2 --logfile boot.log --loglevel info --url http://localhost:$vmess_port"
|
||||
args="tunnel --url http://localhost:$vmess_port --no-autoupdate --logfile boot.log --loglevel info"
|
||||
@@ -1069,7 +1039,6 @@ rules:
|
||||
EOF
|
||||
|
||||
sleep 2
|
||||
[ -d "$FILE_PATH" ] || mkdir -p "$FILE_PATH"
|
||||
v2sub=$(cat jh.txt)
|
||||
echo "$v2sub" > ${FILE_PATH}/${UUID}_v2sub.txt
|
||||
cat clash_meta.yaml > ${FILE_PATH}/${UUID}_clashmeta.txt
|
||||
@@ -1078,13 +1047,14 @@ curl -sL https://raw.githubusercontent.com/yonggekkk/sing-box-yg/main/index.html
|
||||
V2rayN_LINK="https://${USERNAME}.serv00.net/${UUID}_v2sub.txt"
|
||||
Clashmeta_LINK="https://${USERNAME}.serv00.net/${UUID}_clashmeta.txt"
|
||||
Singbox_LINK="https://${USERNAME}.serv00.net/${UUID}_singbox.txt"
|
||||
allip=$(cat hy2ip.txt)
|
||||
cat > list.txt <<EOF
|
||||
=================================================================================================
|
||||
|
||||
当前客户端正在使用的IP:$IP
|
||||
如默认节点IP被墙,可在客户端地址更换以下其他IP
|
||||
$allip
|
||||
$(dig @8.8.8.8 +time=5 +short "web$nb.serv00.com" | sort -u)
|
||||
$(dig @8.8.8.8 +time=5 +short "$HOSTNAME" | sort -u)
|
||||
$(dig @8.8.8.8 +time=5 +short "cache$nb.serv00.com" | sort -u)
|
||||
-------------------------------------------------------------------------------------------------
|
||||
|
||||
一、Vless-reality分享链接如下:
|
||||
@@ -1175,7 +1145,6 @@ rm -rf $HOME/domains/${snb}.${USERNAME}.serv00.net/logs/*
|
||||
install_singbox() {
|
||||
cd $WORKDIR
|
||||
read_ip
|
||||
argo_configure
|
||||
uuidport
|
||||
download_and_run_singbox
|
||||
get_links
|
||||
|
||||
Reference in New Issue
Block a user