Add new a tool ds.sh

A commandline script to upload given files to docspell. The URLs can
be configured using a configuration file.
This commit is contained in:
Eike Kettner
2019-09-19 00:23:25 +02:00
parent c76af5cbf4
commit 30b5c9d7f8
3 changed files with 212 additions and 1 deletions

View File

@ -97,7 +97,7 @@ info() {
upload() {
tf=$($MKTEMP_CMD) rc=0
$CURL_CMD -s -o "$tf" -w "%{http_code}" -XPOST -F file=@"$1" "$2" | (2>&1 1>/dev/null grep 200)
$CURL_CMD -# -o "$tf" --stderr "$tf" -w "%{http_code}" -XPOST -F file=@"$1" "$2" | (2>&1 1>/dev/null grep 200)
rc=$(expr $rc + $?)
cat $tf | (2>&1 1>/dev/null grep '{"success":true')
rc=$(expr $rc + $?)