
On 12/25/2019 02:47 AM, David C. Rankin wrote:
This came up a month or so back, susepaste reports that it failed on the command line, but the paste actually succeeds. I believe it was a curl issue at the time and there was a recommendation on changing the script from http to https to make curl happy.
Well, it still continues to report failure even though the paste succeeds, e.g.
$ pst "ptr2array-3" ptr2array3.c c Dec 25 02:38:00 - "ptr2array-3" ptr2array3.c Paste failed :-( expires: Wed Jan 22 02:38:02 CST 2020
Paste happily made it: https://paste.opensuse.org/70684135
but I still get the "Paste failed :-(" message. http/https makes no difference. Any suggestions?
(also... to you and your's this holiday!)
I have it working. Here are the modifications: <snip> URL="` curl -v -F "$TYPE=$INPUT" -F "title=$TITLE" -F "expire=$EXPIRE" \ -F "name=$NICK" -F "submit=submit" -F "lang=$SYNTAX" \ $API_KEY \ http://susepaste.org 2>&1 | sed -n 's|<\ Location:\ ||p' `" # Check the results and inform the user if expr "$URL" : "^http.*://susepaste.org/[0-9a-f]\+" > /dev/null; then ID="`echo "$URL" | sed 's|^.*[.]org/\([0-9a-f]\+\)[^0-9a-f]*|\1|'`" echo "Pasted as:" echo " https://susepaste.org/$ID" echo " https://paste.opensuse.org/$ID" if [ -x /usr/bin/xclip ]; then echo "https://susepaste.org/$ID" | xclip -selection XA_CLIPBOARD echo "Link is also in your clipboard." fi else echo "Paste failed :-(" fi Changes applied: (1) in curl, leave as http://susepaste.org (2) depending on whether curl report http/https, change the regex in if expr "$URL" : "^http.*://susepaste.org/[0-9a-f]\+" > /dev/null; then (to make the 's' optional) (3) to eliminate the same issue in parsing ID key off the .org in the host.domain.tld modifying the regex to ...^.*[.]org... in ID="`echo "$URL" | sed 's|^.*[.]org/\([0-9a-f]\+\)[^0-9a-f]*|\1|'`" Now working like a charm. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org