Fix newline stripping when passing the tmp file as path

This fixes the issue where the input data gets too large for the
commandline argument buffer
This commit is contained in:
Johannes Zellner
2021-11-09 16:05:34 +01:00
parent 9897b5d18a
commit 0313a60f44

View File

@@ -141,8 +141,7 @@ if [[ "${enableSSH}" == "true" ]]; then
fi
echo -n "Uploading information..."
# for some reason not using $(cat $OUT) will not contain newlines!?
paste_key=$(curl -X POST ${PASTEBIN}/documents --silent -d "$(cat $OUT)" | python3 -c "import sys, json; print(json.load(sys.stdin)['key'])")
paste_key=$(curl -X POST ${PASTEBIN}/documents --silent --data-binary "@$OUT" | python3 -c "import sys, json; print(json.load(sys.stdin)['key'])")
echo "Done"
echo ""