[enh] adds hooks contents
This commit is contained in:
parent
375bf66c2c
commit
031aad7aa3
2 changed files with 56 additions and 4 deletions
16
hooks-content/hastebin.sh
Normal file
16
hooks-content/hastebin.sh
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
HOOKS_CONTENT+=( hookContentHastebin )
|
||||
|
||||
HASTEBIN_SERVER=https://paste.interhacker.space
|
||||
|
||||
hookContentHastebin(){
|
||||
|
||||
[[ -z "$1" ]] && echo "Store a file by name in pastebin" && return
|
||||
TMP="$1"
|
||||
read -e -p "File location? " FILE
|
||||
[[ ! -f $FILE ]] && panic "Not a valid file" && exit
|
||||
URL=$( curl -X POST -s -d "$(cat "$FILE" )" "$HASTEBIN_SERVER/documents" | awk -F '"' '{print "'$HASTEBIN_SERVER'/raw/"$4}'; )
|
||||
echo "$FILE: $URL" >> $TMP
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue