fix scn_send script with non-urlencoded data
This commit is contained in:
parent
f3658d6636
commit
56bf266919
@ -85,26 +85,26 @@ usage<span class="o">()</span><span class="w"> </span><span class="o">{</span>
|
|||||||
|
|
||||||
<span class="nv">curlparams</span><span class="o">=()</span>
|
<span class="nv">curlparams</span><span class="o">=()</span>
|
||||||
|
|
||||||
<span class="nv">curlparams</span><span class="o">+=(</span><span class="w"> </span><span class="s2">"--data"</span><span class="w"> </span><span class="s2">"user_id=</span><span class="si">${</span><span class="nv">SCN_UID</span><span class="si">}</span><span class="s2">"</span><span class="w"> </span><span class="o">)</span>
|
<span class="nv">curlparams</span><span class="o">+=(</span><span class="w"> </span><span class="s2">"--data-urlencode"</span><span class="w"> </span><span class="s2">"user_id=</span><span class="si">${</span><span class="nv">SCN_UID</span><span class="si">}</span><span class="s2">"</span><span class="w"> </span><span class="o">)</span>
|
||||||
<span class="nv">curlparams</span><span class="o">+=(</span><span class="w"> </span><span class="s2">"--data"</span><span class="w"> </span><span class="s2">"key=</span><span class="si">${</span><span class="nv">SCN_KEY</span><span class="si">}</span><span class="s2">"</span><span class="w"> </span><span class="o">)</span>
|
<span class="nv">curlparams</span><span class="o">+=(</span><span class="w"> </span><span class="s2">"--data-urlencode"</span><span class="w"> </span><span class="s2">"key=</span><span class="si">${</span><span class="nv">SCN_KEY</span><span class="si">}</span><span class="s2">"</span><span class="w"> </span><span class="o">)</span>
|
||||||
<span class="nv">curlparams</span><span class="o">+=(</span><span class="w"> </span><span class="s2">"--data"</span><span class="w"> </span><span class="s2">"title=</span><span class="nv">$title</span><span class="s2">"</span><span class="w"> </span><span class="o">)</span>
|
<span class="nv">curlparams</span><span class="o">+=(</span><span class="w"> </span><span class="s2">"--data-urlencode"</span><span class="w"> </span><span class="s2">"title=</span><span class="nv">$title</span><span class="s2">"</span><span class="w"> </span><span class="o">)</span>
|
||||||
<span class="nv">curlparams</span><span class="o">+=(</span><span class="w"> </span><span class="s2">"--data"</span><span class="w"> </span><span class="s2">"timestamp=</span><span class="nv">$sendtime</span><span class="s2">"</span><span class="w"> </span><span class="o">)</span>
|
<span class="nv">curlparams</span><span class="o">+=(</span><span class="w"> </span><span class="s2">"--data-urlencode"</span><span class="w"> </span><span class="s2">"timestamp=</span><span class="nv">$sendtime</span><span class="s2">"</span><span class="w"> </span><span class="o">)</span>
|
||||||
<span class="nv">curlparams</span><span class="o">+=(</span><span class="w"> </span><span class="s2">"--data"</span><span class="w"> </span><span class="s2">"msg_id=</span><span class="nv">$usr_msg_id</span><span class="s2">"</span><span class="w"> </span><span class="o">)</span>
|
<span class="nv">curlparams</span><span class="o">+=(</span><span class="w"> </span><span class="s2">"--data-urlencode"</span><span class="w"> </span><span class="s2">"msg_id=</span><span class="nv">$usr_msg_id</span><span class="s2">"</span><span class="w"> </span><span class="o">)</span>
|
||||||
|
|
||||||
<span class="k">if</span><span class="w"> </span><span class="o">[[</span><span class="w"> </span>-n<span class="w"> </span><span class="s2">"</span><span class="nv">$content</span><span class="s2">"</span><span class="w"> </span><span class="o">]]</span><span class="p">;</span><span class="w"> </span><span class="k">then</span>
|
<span class="k">if</span><span class="w"> </span><span class="o">[[</span><span class="w"> </span>-n<span class="w"> </span><span class="s2">"</span><span class="nv">$content</span><span class="s2">"</span><span class="w"> </span><span class="o">]]</span><span class="p">;</span><span class="w"> </span><span class="k">then</span>
|
||||||
<span class="w"> </span><span class="nv">curlparams</span><span class="o">+=(</span><span class="s2">"--data"</span><span class="w"> </span><span class="s2">"content=</span><span class="nv">$content</span><span class="s2">"</span><span class="o">)</span>
|
<span class="w"> </span><span class="nv">curlparams</span><span class="o">+=(</span><span class="s2">"--data-urlencode"</span><span class="w"> </span><span class="s2">"content=</span><span class="nv">$content</span><span class="s2">"</span><span class="o">)</span>
|
||||||
<span class="k">fi</span>
|
<span class="k">fi</span>
|
||||||
|
|
||||||
<span class="k">if</span><span class="w"> </span><span class="o">[[</span><span class="w"> </span>-n<span class="w"> </span><span class="s2">"</span><span class="nv">$priority</span><span class="s2">"</span><span class="w"> </span><span class="o">]]</span><span class="p">;</span><span class="w"> </span><span class="k">then</span>
|
<span class="k">if</span><span class="w"> </span><span class="o">[[</span><span class="w"> </span>-n<span class="w"> </span><span class="s2">"</span><span class="nv">$priority</span><span class="s2">"</span><span class="w"> </span><span class="o">]]</span><span class="p">;</span><span class="w"> </span><span class="k">then</span>
|
||||||
<span class="w"> </span><span class="nv">curlparams</span><span class="o">+=(</span><span class="s2">"--data"</span><span class="w"> </span><span class="s2">"priority=</span><span class="nv">$priority</span><span class="s2">"</span><span class="o">)</span>
|
<span class="w"> </span><span class="nv">curlparams</span><span class="o">+=(</span><span class="s2">"--data-urlencode"</span><span class="w"> </span><span class="s2">"priority=</span><span class="nv">$priority</span><span class="s2">"</span><span class="o">)</span>
|
||||||
<span class="k">fi</span>
|
<span class="k">fi</span>
|
||||||
|
|
||||||
<span class="k">if</span><span class="w"> </span><span class="o">[[</span><span class="w"> </span>-n<span class="w"> </span><span class="s2">"</span><span class="nv">$channel</span><span class="s2">"</span><span class="w"> </span><span class="o">]]</span><span class="p">;</span><span class="w"> </span><span class="k">then</span>
|
<span class="k">if</span><span class="w"> </span><span class="o">[[</span><span class="w"> </span>-n<span class="w"> </span><span class="s2">"</span><span class="nv">$channel</span><span class="s2">"</span><span class="w"> </span><span class="o">]]</span><span class="p">;</span><span class="w"> </span><span class="k">then</span>
|
||||||
<span class="w"> </span><span class="nv">curlparams</span><span class="o">+=(</span><span class="s2">"--data"</span><span class="w"> </span><span class="s2">"channel=</span><span class="nv">$channel</span><span class="s2">"</span><span class="o">)</span>
|
<span class="w"> </span><span class="nv">curlparams</span><span class="o">+=(</span><span class="s2">"--data-urlencode"</span><span class="w"> </span><span class="s2">"channel=</span><span class="nv">$channel</span><span class="s2">"</span><span class="o">)</span>
|
||||||
<span class="k">fi</span>
|
<span class="k">fi</span>
|
||||||
|
|
||||||
<span class="k">if</span><span class="w"> </span><span class="o">[[</span><span class="w"> </span>-n<span class="w"> </span><span class="s2">"</span><span class="nv">$sender</span><span class="s2">"</span><span class="w"> </span><span class="o">]]</span><span class="p">;</span><span class="w"> </span><span class="k">then</span>
|
<span class="k">if</span><span class="w"> </span><span class="o">[[</span><span class="w"> </span>-n<span class="w"> </span><span class="s2">"</span><span class="nv">$sender</span><span class="s2">"</span><span class="w"> </span><span class="o">]]</span><span class="p">;</span><span class="w"> </span><span class="k">then</span>
|
||||||
<span class="w"> </span><span class="nv">curlparams</span><span class="o">+=(</span><span class="s2">"--data"</span><span class="w"> </span><span class="s2">"sender_name=</span><span class="nv">$sender</span><span class="s2">"</span><span class="o">)</span>
|
<span class="w"> </span><span class="nv">curlparams</span><span class="o">+=(</span><span class="s2">"--data-urlencode"</span><span class="w"> </span><span class="s2">"sender_name=</span><span class="nv">$sender</span><span class="s2">"</span><span class="o">)</span>
|
||||||
<span class="k">fi</span>
|
<span class="k">fi</span>
|
||||||
|
|
||||||
<span class="k">while</span><span class="w"> </span><span class="nb">true</span><span class="w"> </span><span class="p">;</span><span class="w"> </span><span class="k">do</span>
|
<span class="k">while</span><span class="w"> </span><span class="nb">true</span><span class="w"> </span><span class="p">;</span><span class="w"> </span><span class="k">do</span>
|
||||||
|
@ -85,26 +85,26 @@ fi
|
|||||||
|
|
||||||
curlparams=()
|
curlparams=()
|
||||||
|
|
||||||
curlparams+=( "--data" "user_id=${SCN_UID}" )
|
curlparams+=( "--data-urlencode" "user_id=${SCN_UID}" )
|
||||||
curlparams+=( "--data" "key=${SCN_KEY}" )
|
curlparams+=( "--data-urlencode" "key=${SCN_KEY}" )
|
||||||
curlparams+=( "--data" "title=$title" )
|
curlparams+=( "--data-urlencode" "title=$title" )
|
||||||
curlparams+=( "--data" "timestamp=$sendtime" )
|
curlparams+=( "--data-urlencode" "timestamp=$sendtime" )
|
||||||
curlparams+=( "--data" "msg_id=$usr_msg_id" )
|
curlparams+=( "--data-urlencode" "msg_id=$usr_msg_id" )
|
||||||
|
|
||||||
if [[ -n "$content" ]]; then
|
if [[ -n "$content" ]]; then
|
||||||
curlparams+=("--data" "content=$content")
|
curlparams+=("--data-urlencode" "content=$content")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$priority" ]]; then
|
if [[ -n "$priority" ]]; then
|
||||||
curlparams+=("--data" "priority=$priority")
|
curlparams+=("--data-urlencode" "priority=$priority")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$channel" ]]; then
|
if [[ -n "$channel" ]]; then
|
||||||
curlparams+=("--data" "channel=$channel")
|
curlparams+=("--data-urlencode" "channel=$channel")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$sender" ]]; then
|
if [[ -n "$sender" ]]; then
|
||||||
curlparams+=("--data" "sender_name=$sender")
|
curlparams+=("--data-urlencode" "sender_name=$sender")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while true ; do
|
while true ; do
|
||||||
|
Loading…
Reference in New Issue
Block a user