Fixed proxychains output in OTS as well as multiple-line body on POST reqs

This commit is contained in:
kexkey
2020-03-22 22:30:58 -04:00
parent e9321b64f3
commit 0a5526e8b4
2 changed files with 8 additions and 7 deletions

View File

@@ -21,11 +21,11 @@ stamp() {
if [ "${TESTNET}" -eq "1" ]; then if [ "${TESTNET}" -eq "1" ]; then
trace "[stamp] ${proxychains} ots-cli.js stamp -c \"https://ots.testnet.kexkey.com\" -d ${hash}" trace "[stamp] ${proxychains} ots-cli.js stamp -c \"https://ots.testnet.kexkey.com\" -d ${hash}"
result=$(cd /otsfiles && sh -c "${proxychains} ots-cli.js stamp -c 'https://ots.testnet.kexkey.com' -d ${hash} 2>&1") result=$(cd /otsfiles && sh -c "${proxychains} ots-cli.js stamp -c 'https://ots.testnet.kexkey.com' -d ${hash} 2>&1 | sed '/^\[proxychains\].*$/d'")
returncode=$? returncode=$?
else else
trace "[stamp] ${proxychains} ots-cli.js stamp -d ${hash}" trace "[stamp] ${proxychains} ots-cli.js stamp -d ${hash}"
result=$(cd /otsfiles && sh -c "${proxychains} ots-cli.js stamp -d ${hash} 2>&1") result=$(cd /otsfiles && sh -c "${proxychains} ots-cli.js stamp -d ${hash} 2>&1 | sed '/^\[proxychains\].*$/d'")
returncode=$? returncode=$?
fi fi
trace_rc ${returncode} trace_rc ${returncode}
@@ -71,11 +71,11 @@ upgrade() {
if [ "${TESTNET}" -eq "1" ]; then if [ "${TESTNET}" -eq "1" ]; then
trace "[upgrade] ${proxychains} ots-cli.js -l \"https://testnet.calendar.kexkey.com/\" --no-default-whitelist upgrade -c \"https://testnet.calendar.kexkey.com/\" ${hash}.ots" trace "[upgrade] ${proxychains} ots-cli.js -l \"https://testnet.calendar.kexkey.com/\" --no-default-whitelist upgrade -c \"https://testnet.calendar.kexkey.com/\" ${hash}.ots"
result=$(cd /otsfiles && sh -c "${proxychains} ots-cli.js -l 'https://testnet.calendar.kexkey.com/' --no-default-whitelist upgrade -c 'https://testnet.calendar.kexkey.com/' ${hash}.ots 2>&1") result=$(cd /otsfiles && sh -c "${proxychains} ots-cli.js -l 'https://testnet.calendar.kexkey.com/' --no-default-whitelist upgrade -c 'https://testnet.calendar.kexkey.com/' ${hash}.ots 2>&1 | sed '/^\[proxychains\].*$/d'")
returncode=$? returncode=$?
else else
trace "[upgrade] ${proxychains} ots-cli.js upgrade ${hash}.ots" trace "[upgrade] ${proxychains} ots-cli.js upgrade ${hash}.ots"
result=$(cd /otsfiles && sh -c "${proxychains} ots-cli.js upgrade ${hash}.ots 2>&1") result=$(cd /otsfiles && sh -c "${proxychains} ots-cli.js upgrade ${hash}.ots 2>&1 | sed '/^\[proxychains\].*$/d'")
returncode=$? returncode=$?
fi fi
trace_rc ${returncode} trace_rc ${returncode}
@@ -129,11 +129,11 @@ verify() {
if [ "${TESTNET}" -eq "1" ]; then if [ "${TESTNET}" -eq "1" ]; then
trace "[verify] ${proxychains} ots-cli.js -l \"https://testnet.calendar.kexkey.com/\" --no-default-whitelist verify -d ${hash} /otsfiles/otsfile-$$.ots" trace "[verify] ${proxychains} ots-cli.js -l \"https://testnet.calendar.kexkey.com/\" --no-default-whitelist verify -d ${hash} /otsfiles/otsfile-$$.ots"
result=$(sh -c "${proxychains} ots-cli.js -l 'https://testnet.calendar.kexkey.com/' --no-default-whitelist verify -d ${hash} /otsfiles/otsfile-$$.ots 2>&1") result=$(sh -c "${proxychains} ots-cli.js -l 'https://testnet.calendar.kexkey.com/' --no-default-whitelist verify -d ${hash} /otsfiles/otsfile-$$.ots 2>&1 | sed '/^\[proxychains\].*$/d'")
returncode=$? returncode=$?
else else
trace "[verify] ${proxychains} ots-cli.js verify -d ${hash} /otsfiles/otsfile-$$.ots" trace "[verify] ${proxychains} ots-cli.js verify -d ${hash} /otsfiles/otsfile-$$.ots"
result=$(sh -c "${proxychains} ots-cli.js verify -d ${hash} /otsfiles/otsfile-$$.ots 2>&1") result=$(sh -c "${proxychains} ots-cli.js verify -d ${hash} /otsfiles/otsfile-$$.ots 2>&1 | sed '/^\[proxychains\].*$/d'")
returncode=$? returncode=$?
fi fi
trace_rc ${returncode} trace_rc ${returncode}

View File

@@ -67,7 +67,8 @@ main() {
if [ ${step} -eq 1 ]; then if [ ${step} -eq 1 ]; then
trace "[main] step=${step}" trace "[main] step=${step}"
if [ "${http_method}" = "POST" ]; then if [ "${http_method}" = "POST" ]; then
read -n ${content_length} line read -rd '' -n ${content_length} line
line=$(echo "${line}" | jq -c)
trace "[main] line=${line}" trace "[main] line=${line}"
fi fi
case "${cmd}" in case "${cmd}" in