2023-08-14 12:11:06 +08:00

50 lines
838 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
#用法sender.sh 下载链接 HD70642
case `arch` in
x86_64)
STORE_URL="store"
;;
aarch64)
STORE_URL="aarch64-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}"'"}' http://zunyun01.store.deepinos.org.cn:38324/handle_post
echo "Finished"