forked from archiver_config/sf_databuffer
add stop image command
This commit is contained in:
20
stop_images.sh
Executable file
20
stop_images.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
HOST="https://dispatcher-api.psi.ch/sf"
|
||||
# HOST="http://localhost:8080"
|
||||
HTTP_ADDRESS="/source"
|
||||
RESPONSE=response.json
|
||||
# see http://stackoverflow.com/questions/18258804/how-to-catch-timeout-errors-in-a-curl-shell-script
|
||||
COMMAND="curl -s -w %{http_code} -H \"Content-Type: application/json\" -X DELETE"
|
||||
|
||||
while read -r -d '' filename; do
|
||||
COMMAND+=" -F files=@${filename}"
|
||||
done < <(find . \( -name "image.sources" \) -print0)
|
||||
|
||||
COMMAND+=" ${HOST}${HTTP_ADDRESS} -o ${RESPONSE}"
|
||||
# echo "Execute command: "${COMMAND}
|
||||
STATUS=$(${COMMAND})
|
||||
|
||||
cat ${RESPONSE} | python -m json.tool
|
||||
rm -f ${RESPONSE}
|
||||
#echo ${STATUS}
|
||||
Reference in New Issue
Block a user