first test

This commit is contained in:
2024-04-10 16:04:23 +08:00
parent 4165bea193
commit a86ef64352
19 changed files with 12 additions and 1643 deletions

View File

@@ -1,53 +1,2 @@
#!/bin/bash
SPARK_CORE_SERVER_URL="http://127.0.0.1:38324"
#用法sender.sh 下载链接 HD70642
case `arch` in
x86_64)
STORE_URL="store"
;;
aarch64)
STORE_URL="aarch64-store"
;;
loongarch64)
STORE_URL="loong64-store"
;;
esac
if [ -z $1 ] || [ "$2" != "HD70642" ];then
echo "Segment fault"
# 假的段错误
exit -1
fi
APP_LOCATION=${1#*/$STORE_URL/}
APP_LOCATION=${APP_LOCATION%/*}
echo $APP_LOCATION
APP_METALINK_FILE_NAME=${1##*/}
#echo $APP_METALINK_FILE_NAME
PIDS=$(pidof "spark-store")
# 检查 metalink以防止未下载时刷分
if [ ! -f /tmp/spark-store/$APP_METALINK_FILE_NAME ] || [ "$PIDS" = "" ];then
sleep 1
echo "发送!成功"
exit
# 其实是发送不成功的意思lolol
fi
echo $STORE_URL/$APP_LOCATION
curl -X POST -H "Content-Type: application/json" -d '{"path": "'"${STORE_URL}/${APP_LOCATION}"'"}' ${SPARK_CORE_SERVER_URL}/handle_post
echo "Finished"
host-spawn $0 $@