forked from JarlPenguin/releases
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathper.sh
14 lines (13 loc) · 791 Bytes
/
per.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export tgid=$(curl --data parse_mode=HTML --data chat_id=$TELEGRAM_CHAT --data message_id=553 --data text=Waiting --request POST https://api.telegram.org/bot$TELEGRAM_TOKEN/sendMessage | grep -Eo '"message_id".*"sender_chat"' | grep -Eo '[0-9]{1,4}')
sleep 20
while true
do
num1=$(protoc --decode_raw < ~/releases/android/out/build_progress.pb | cut -c 4- | head -1)
num2=$(protoc --decode_raw < ~/releases/android/out/build_progress.pb | cut -b 4- | head -n 2 | tail -n 1)
export per="$(echo "scale=2; $num2 / $num1*100" | bc)"
curl --data parse_mode=HTML --data chat_id=$TELEGRAM_CHAT --data message_id=$tgid --data text=$per+% --request POST https://api.telegram.org/bot$TELEGRAM_TOKEN/editMessageText
if [ "$num1" = "$num2" ]; then
break
fi
sleep 170
done