From 8890984007de8b10e6ee8ff8fffe537b3d670c03 Mon Sep 17 00:00:00 2001 From: alban Date: Wed, 3 Jun 2020 21:51:32 +0200 Subject: [PATCH] [fix] content hastebin should work --- plugins-available/content-hastebin.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins-available/content-hastebin.sh b/plugins-available/content-hastebin.sh index 2b7a238..aa1d03b 100644 --- a/plugins-available/content-hastebin.sh +++ b/plugins-available/content-hastebin.sh @@ -1,15 +1,15 @@ #!/bin/bash -# Sends the changelog information to a changelog server -# see https://git.interhacker.space/alban/changelog-server +# Adds a line by sending a file to a hastebin server +# and then print a "/a/file/name https://haste.bin/urlurlurl" line # Requires an environmental variable to work -# ex: HASTEBIN_SERVER=https://paste.interhacker.space +# example HASTEBIN_SERVER=https://paste.interhacker.space PLUGIN_CONTENT+=( hookContentHastebin ) hookContentHastebin(){ [[ -z "$1" ]] && echo "Store a file by name in pastebin" && return [[ -z "$HASTEBIN_SERVER" ]] && echo "Missing HASTEBIN_SERVER variable. Exiting." && return TMP="$1" read -e -p "File location? " FILE - [[ ! -f $FILE ]] && panic "Not a valid file" && exit + [[ ! -f $FILE ]] && panic "Not a valid file" && return URL=$( curl -X POST -s -d "$(cat "$FILE" )" "$HASTEBIN_SERVER/documents" | awk -F '"' '{print "'$HASTEBIN_SERVER'/raw/"$4}'; ) echo "$FILE: $URL" >> $TMP }