testnet support for OTS

This commit is contained in:
kexkey
2019-08-19 11:02:18 -04:00
committed by kexkey
parent 8168bed0d5
commit c2d33139ef
3 changed files with 51 additions and 15 deletions

View File

@@ -202,14 +202,23 @@ serve_ots_backoffice() {
url=$(echo "${row}" | cut -d '|' -f2)
trace "[serve_ots_backoffice] url=${url}"
# Call back newly upgraded stamps
notify_web "${url}"
returncode=$?
trace_rc ${returncode}
# Call back newly upgraded stamps if url provided
if [ -n ${url} ]; then
trace "[serve_ots_backoffice] url is not empty, now trying to call it!"
# Even if curl executed ok, we need to make sure the http return code is also ok
notify_web "${url}"
returncode=$?
trace_rc ${returncode}
# Even if curl executed ok, we need to make sure the http return code is also ok
if [ "${returncode}" -eq "0" ]; then
sql "UPDATE stamp SET calledback=1 WHERE id=${id}"
trace_rc $?
fi
else
trace "[serve_ots_backoffice] url is empty, obviously won't try to call it!"
if [ "${returncode}" -eq "0" ]; then
sql "UPDATE stamp SET calledback=1 WHERE id=${id}"
trace_rc $?
fi