From: David Woodhouse Date: Mon, 19 Jul 2010 21:40:01 +0000 (+0100) Subject: Dump reply XML only if there's a problem X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3b26620322e5b9c80c3c4e3b407fd0284bf1e057;p=users%2Fdwmw2%2Fews-sync.git Dump reply XML only if there's a problem --- diff --git a/syncfolder.sh b/syncfolder.sh index 21be635..129835d 100755 --- a/syncfolder.sh +++ b/syncfolder.sh @@ -51,7 +51,7 @@ if ! curl $CURLAUTH -L -H "Content-Type: text/xml" \ $EWSURL -d @$QUERYFILE > $RESULTFILE; then exit 1 fi -sed 's/\(<[^/]\)/\n\1/g' $RESULTFILE + echo # I'm far too lazy to do proper XML parsing for a proof-of-concept (sed 's/\(<[^/]\)/\n\1/g' $RESULTFILE; echo) | while read LINE; do @@ -83,7 +83,10 @@ fi NEWSYNCSTATE=$(sed -n '//{s/.*\(.*\)<\/m:SyncState>.*/\1/p}' $RESULTFILE) if [ "$NEWSYNCSTATE" = "" ]; then - echo "No found in response" + sed 's/\(<[^/]\)/\n\1/g' $RESULTFILE + echo + echo + echo "No found in response (shown above); aborting" exit 1 fi