File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ USAGE='process_update.sh [-h|--help] [debug] [<file]'
1515# AUTHOR: KayM (gnadelwartz), [email protected] 1616# CREATED: 30.01.2021 19:14
1717#
18- # ### $$VERSION$$ v1.40-0-gf9dab50
18+ # ### $$VERSION$$ v1.45-dev-30-g8efbfca
1919# ===============================================================================
2020
2121# ###
@@ -34,6 +34,9 @@ print_help "${1:-nix}"
3434json=' {"result": [' " $( cat) " ' ]}'
3535UPDATE=" $( ${JSONSHFILE} -b -n <<< " ${json}" 2> /dev/null) "
3636
37+ # escape bash $ expansion bug
38+ UPDATE=" ${UPDATE// $/ \\ $} "
39+
3740# assign to bashbot ARRAY
3841Json2Array ' UPD' <<< " ${UPDATE}"
3942
Original file line number Diff line number Diff line change 55# This file is public domain in the USA and all free countries.
66# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
77#
8- # ### $$VERSION$$ v1.45-dev-29-gd6f37af
8+ # ### $$VERSION$$ v1.45-dev-30-g8efbfca
99#
1010# source from commands.sh to use jsonDB functions
1111#
Original file line number Diff line number Diff line change 44# File: processUpdates.sh
55# Note: DO NOT EDIT! this file will be overwritten on update
66#
7- # ### $$VERSION$$ v1.45-dev-18-g193ca1e
7+ # ### $$VERSION$$ v1.45-dev-30-g8efbfca
88# #################################################################
99
1010# #############
@@ -47,6 +47,8 @@ delete_webhook() {
4747process_multi_updates () {
4848 local max num debug=" $1 "
4949 max=" $( grep -F ' ,"update_id"]' <<< " ${UPDATE}" | tail -1 | cut -d , -f 2 ) "
50+ # escape bash $ expansion bug
51+ UPDATE=" ${UPDATE// $/ \\ $} "
5052 Json2Array ' UPD' <<< " ${UPDATE}"
5153 for (( num= 0 ; num<= max; num++ )) ; do
5254 process_update " ${num} " " ${debug} "
@@ -345,8 +347,6 @@ get_updates(){
345347 log_error " Recovered from timeout/broken/no connection, continue with telegram updates"
346348 # calculate next sleep interval
347349 (( nextsleep+= stepsleep , nextsleep= nextsleep> maxsleep ? maxsleep: nextsleep))
348- # escape bash $ expansion bug
349- UPDATE=" ${UPDATE// $/ \\ $} "
350350 # warn if webhook is set
351351 if grep -q ' ^\["error_code"\] 409' <<< " ${UPDATE}" ; then
352352 [ " ${OFFSET} " != " -999" ] && nextsleep=" ${stepsleep} "
You can’t perform that action at this time.
0 commit comments