[fix] Bit of renaming things
This commit is contained in:
parent
e77830a144
commit
d296e615e9
6 changed files with 71 additions and 52 deletions
16
plugins-available/content-hastebin.sh
Normal file
16
plugins-available/content-hastebin.sh
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
# Sends the changelog information to a changelog server
|
||||
# see https://git.interhacker.space/alban/changelog-server
|
||||
# Requires an environmental variable to work
|
||||
# ex: 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
|
||||
URL=$( curl -X POST -s -d "$(cat "$FILE" )" "$HASTEBIN_SERVER/documents" | awk -F '"' '{print "'$HASTEBIN_SERVER'/raw/"$4}'; )
|
||||
echo "$FILE: $URL" >> $TMP
|
||||
}
|
||||
|
||||
18
plugins-available/output-changelog-server.sh
Normal file
18
plugins-available/output-changelog-server.sh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
# Sends the changelog information to a changelog server
|
||||
# see https://git.interhacker.space/alban/changelog-server
|
||||
# Requires environmental variables to work
|
||||
# CHANGELOG_SERVER
|
||||
# CHANGELOG_AUTH_KEY
|
||||
PLUGIN_OUTPUT+=( hookOutputChangelogServer )
|
||||
hookOutputChangelogServer(){
|
||||
[[ -z "$1" ]] && echo "Sending changelog to remote server" && return
|
||||
[[ -z "$CHANGELOG_SERVER" ]] && echo "Missing CHANGELOG_SERVER variable. Exiting." && return
|
||||
[[ -z "$CHANGELOG_AUTH_KEY" ]] && echo "Missing CHANGELOG_AUTH_KEY variable. Exiting." && return
|
||||
CONTENT=$(jq -aRs . $1|tr '"' '\"')
|
||||
PAYLOAD="{\"author\":\"$CHANGELOG_USERNAME\",\"server\":\"$(hostname -f)\",\"content\":${CONTENT}}"
|
||||
URL=$( curl -X POST -H "AuthorizationToken: $CHANGELOG_AUTH_KEY" -H "Content-Type: application/json" -s -d "${PAYLOAD}" "$CHANGELOG_SERVER/changelog/_doc"; )
|
||||
[[ 0 -ne $? ]] && echo "Failed to upload the changelog..." && return
|
||||
echo "$FILE: $URL" >> $TMP
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue