Просмотр исходного кода

Hastebin seems to have gone https-only and changed up their API

cedarlug 9 лет назад
Родитель
Сommit
0876103625
1 измененных файлов с 6 добавлено и 6 удалено
  1. 6 6
      lgsm/functions/command_postdetails.sh

+ 6 - 6
lgsm/functions/command_postdetails.sh

@@ -17,7 +17,7 @@ postdetails=yes
 
 # The options for posttarget are:
 # The default destination - hastebin
-# posttarget="http://hastebin.com"
+# posttarget="https://hastebin.com"
 #
 # Secondary destination - pastebin
 # posttarget="http://pastebin.com
@@ -31,7 +31,7 @@ postdetails=yes
 # to post to pastebin, or
 #  rustserver@gamerig:~$ posttarget= ./rustserver pd
 # to leave the output on the filesystem.
-posttarget=${posttarget="http://hastebin.com"}
+posttarget=${posttarget="https://hastebin.com"}
 
 # For pastebin, you can set the expiration period.
 # use 1 week as the default, other options are '24h' for a day, etc.
@@ -126,16 +126,16 @@ if [ "${posttarget}" == "http://pastebin.com" ] ; then
 
 	 # Output the resulting link.
 	fn_print_ok_nl "Posting details to pastbin.com for ${postexpire}"
-	echo "  * url: ${posttarget}${link}"
-elif [ "${posttarget}" == "http://hastebin.com" ] ; then
+	echo "  Please share the following url for support: ${posttarget}${link}"
+elif [ "${posttarget}" == "https://hastebin.com" ] ; then
 	fn_print_dots "Posting details to hastebin.com for ${postexpire}"
 	sleep 1
 	# hastebin is a bit simpler.  If successful, the returned result
 	# should look like: {"something":"key"}, putting the reference that
 	# we need in "key".  TODO - error handling. -CedarLUG
-	link=$(curl -s -d "$(<${tmpfile})" "${posttarget}/documents" | cut -d\" -f4)
+	link=$(curl -H "HTTP_X_REQUESTED_WITH:XMLHttpRequest" -s -d "$(<${tmpfile})" "${posttarget}/documents" | cut -d\" -f4)
 	fn_print_ok_nl "Posting details to hastebin.com for ${postexpire}"
-	echo "  * url: ${posttarget}/${link}"
+	echo "  Please share the following url for support: ${posttarget}/${link}"
 else
 	 fn_print_warn_nl Review the output in "${tmpfile}"
 	 core_exit.sh