Skip to content

Commit

Permalink
allow multiple ids
Browse files Browse the repository at this point in the history
Signed-off-by: Zoey <[email protected]>
  • Loading branch information
Zoey2936 authored Nov 11, 2023
1 parent c3c64bf commit fbaa88f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ if [ -z "$TBT" ] || ! echo "$TBT" | grep -q "^[A-Za-z0-9:]\+$"; then
sleep inf
fi

if [ -z "$TCID" ] || ! echo "$TCID" | grep -q "^[0-9]\+$"; then
echo "TCID is unset or invalid, it can consist of numbers 0-9."
if [ -z "$TCIDs" ] || ! echo "$TCIDs" | grep -q "^[0-9 ]\+$"; then
echo "TCIDs is unset or invalid, it can consist of numbers 0-9 and spaces."
sleep inf
fi

Expand Down Expand Up @@ -99,10 +99,14 @@ done
echo "$message"


curl -X POST \
-H 'Content-Type: application/json' \
-d '{"chat_id": "'"$TCID"'", "text": "'"$message"'", "disable_notification": true}' \
https://api.telegram.org/bot"$TBT"/sendMessage
for TCID in $(echo "$TCIDs" | tr " " "\n"); do

curl -X POST \
-H 'Content-Type: application/json' \
-d '{"chat_id": "'"$TCID"'", "text": "'"$message"'", "disable_notification": true}' \
https://api.telegram.org/bot"$TBT"/sendMessage

done

sleep "$CI"
done

0 comments on commit fbaa88f

Please sign in to comment.