mirror of
https://github.com/everett7623/nodeloc_vps_test.git
synced 2024-11-20 15:05:22 +00:00
兼容新的系统接口
This commit is contained in:
parent
0b770cf2cd
commit
0d8268ecf1
33
Nlbench.sh
33
Nlbench.sh
@ -4,7 +4,7 @@
|
|||||||
CURRENT_VERSION="2024-09-07 v1.2.3" # 最新版本号
|
CURRENT_VERSION="2024-09-07 v1.2.3" # 最新版本号
|
||||||
SCRIPT_URL="https://raw.githubusercontent.com/everett7623/nodeloc_vps_test/main/Nlbench.sh"
|
SCRIPT_URL="https://raw.githubusercontent.com/everett7623/nodeloc_vps_test/main/Nlbench.sh"
|
||||||
VERSION_URL="https://raw.githubusercontent.com/everett7623/nodeloc_vps_test/main/version.sh"
|
VERSION_URL="https://raw.githubusercontent.com/everett7623/nodeloc_vps_test/main/version.sh"
|
||||||
PASTE_SERVICE_URL="http://nodeloc.uukk.de/test/"
|
CLOUD_SERVICE_BASE="https://bench.nodeloc.cc/"
|
||||||
|
|
||||||
# 定义颜色
|
# 定义颜色
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
@ -477,23 +477,22 @@ generate_markdown_output() {
|
|||||||
|
|
||||||
echo "[/tabs]" >> "$temp_output_file"
|
echo "[/tabs]" >> "$temp_output_file"
|
||||||
|
|
||||||
# 生成包含时间戳和随机字符的文件名
|
|
||||||
local timestamp=$(date +"%Y%m%d%H%M%S")
|
# 上传文件 获取回调
|
||||||
local random_chars=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1)
|
local plain_uploaded_file=$(cat ${temp_output_file}|curl -s -X POST --data-binary @- ${CLOUD_SERVICE_BASE}test.php);
|
||||||
local filename="${timestamp}${random_chars}.txt"
|
local plain_uploaded_file_filename=$(echo "$plain_uploaded_file" | grep -oP "$CLOUD_SERVICE_BASE\K.*")
|
||||||
|
|
||||||
|
|
||||||
# 构造完整的URL
|
if [ $plain_uploaded_file ]; then
|
||||||
local url="http://nodeloc.uukk.de/test/${filename}"
|
echo -e "${CLOUD_SERVICE_BASE}result/${plain_uploaded_file_filename}\r\nPlain $plain_uploaded_file" > "$plain_uploaded_file_filename.url"
|
||||||
|
|
||||||
# 上传文件
|
echo "测试结果已上传。您可以在以下链接查看:"
|
||||||
if curl -H "Content-Type: text/plain; charset=utf-8" -s -X PUT --data-binary @"$temp_output_file" "$url"; then
|
echo "${CLOUD_SERVICE_BASE}result/${plain_uploaded_file_filename}"
|
||||||
echo "测试结果已上传。您可以在以下链接查看:"
|
echo "Plain $plain_uploaded_file"
|
||||||
echo "$url"
|
echo "结果链接已保存到 $plain_uploaded_file_filename.url"
|
||||||
echo "结果链接已保存到 $base_output_file.url"
|
else
|
||||||
echo "$url" > "$base_output_file.url"
|
echo "上传失败。结果已保存在本地文件 $temp_output_file"
|
||||||
else
|
fi
|
||||||
echo "上传失败。结果已保存在本地文件 $temp_output_file"
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm "$temp_output_file"
|
rm "$temp_output_file"
|
||||||
read -p "按回车键继续..."
|
read -p "按回车键继续..."
|
||||||
|
Loading…
Reference in New Issue
Block a user