From 5713c40336efed5ccdb9d99534849c648edcc776 Mon Sep 17 00:00:00 2001 From: mbugeia Date: Wed, 26 Oct 2016 00:37:22 +0200 Subject: [PATCH] Fix haste command --- conf/haste.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/conf/haste.sh b/conf/haste.sh index 1f38713..e4e5ce7 100644 --- a/conf/haste.sh +++ b/conf/haste.sh @@ -1,8 +1,6 @@ #!/bin/bash -set -eu - -PASTE_URL="https://YNH_HASTE_URL" +PASTE_URL="YNH_HASTE_URL" haste () { local output returnfile contents @@ -33,10 +31,10 @@ haste () { then contents=$(cat $1) fi - output=$(curl -# -f -XPOST "http://"${PASTE_URL}"/documents" -d"$contents") + output=$(curl -# -f -k -XPOST "https://"${PASTE_URL}"/documents" -d"$contents") if (( $? == 0 )) && [[ $output =~ \"key\" ]] then - returnfile=$(sed 's/^.*"key":"/http:\/\/'${PASTE_URL}'\//;s/".*$//' <<< "$output") + returnfile=$(sed 's/^.*"key":"/https:\/\/'${PASTE_URL}'\//;s/".*$//' <<< "$output") if [[ -n $returnfile ]] then echo "$returnfile"