diff --git a/modules/jsonDB.sh b/modules/jsonDB.sh index 411474b..b7f6421 100644 --- a/modules/jsonDB.sh +++ b/modules/jsonDB.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.98-dev-48-g9adc62d +#### $$VERSION$$ v0.98-dev-59-g21f29a4 # # source from commands.sh to use jsonDB functions # @@ -106,8 +106,8 @@ if [ "$(LC_ALL=C type -t "flock")" = "file" ]; then alias jssh_getDB=jssh_getKeyDB jssh_getKeyDB() { [[ "$1" =~ ^[-a-zA-Z0-9,._]+$ ]] || return 3 - [ -z "${DB}" ] && return 1 local DB; DB="$(jssh_checkDB "$2")" + [ -z "${DB}" ] && return 1 # start atomic delete here, exclusive max wait 1s { flock -s -w 1 200 [ -r "${DB}" ] && sed -n 's/\["'"$1"'"\]\t*"\(.*\)"/\1/p' <"${DB}" | tail -n 1 diff --git a/modules/sendMessage.sh b/modules/sendMessage.sh index 33824ef..cb51eaa 100644 --- a/modules/sendMessage.sh +++ b/modules/sendMessage.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.98-dev-58-ge4d13fd +#### $$VERSION$$ v0.98-dev-59-g21f29a4 # will be automatically sourced from bashbot @@ -30,7 +30,7 @@ send_normal_message() { local len text; text="$(JsonEscape "${2}")" text="${text//$'\n'/\\n}" until [ -z "${text}" ]; do - if [ "${#text}" -le 4096 ]; then\ + if [ "${#text}" -le 4096 ]; then sendJson "${1}" '"text":"'"${text}"'"' "${MSG_URL}" unset text else