Update scnsend script: "bugfix for big files in --scnsend-read-body-from-file"
This commit is contained in:
@@ -87,6 +87,7 @@ title="${args[0]}"
|
||||
args=("${args[@]:1}")
|
||||
|
||||
content=""
|
||||
filecontent=""
|
||||
|
||||
if [ ${#args[@]} -gt 0 ]; then
|
||||
content="${args[0]}"
|
||||
@@ -106,7 +107,8 @@ fi
|
||||
|
||||
if [[ "$content" == --scnsend-read-body-from-file=* ]]; then
|
||||
path="$( awk '{ print substr($0, 31) }' <<< "$content" )"
|
||||
content="$( cat "$path" )"
|
||||
filecontent="$path"
|
||||
content=""
|
||||
fi
|
||||
|
||||
curlparams=()
|
||||
@@ -121,6 +123,10 @@ if [[ -n "$content" ]]; then
|
||||
curlparams+=("--data-urlencode" "content=$content")
|
||||
fi
|
||||
|
||||
if [[ -n "$filecontent" && -z "$content" ]]; then
|
||||
curlparams+=("--data-urlencode" "content@$filecontent")
|
||||
fi
|
||||
|
||||
if [[ -n "$priority" ]]; then
|
||||
curlparams+=("--data-urlencode" "priority=$priority")
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user