Skip to content
Permalink
Browse files

dump.bitcheese.net: make shellcheck happy

  • Loading branch information...
l29ah committed Jul 23, 2018
1 parent 74bbbc7 commit dde8f6ef4106d98082a8942280172f8682eb5e50
Showing with 7 additions and 5 deletions.
  1. +7 −5 dump.bitcheese.net/dump
@@ -1,19 +1,21 @@
#!/bin/bash
set -o pipefail
up() {
sum=`sha512sum "$1" | cut -d\ -f1`
url=`curl -sf https://dump.bitcheese.net/search/sha512/$sum?simple | sed -e 's#http#https#'` && echo $url || {
curl -sw %{redirect_url} -F "file=@\"$1\"" https://dump.bitcheese.net/upload-file?simple | sed -e 's#http#https#' | urldecode
sum=$(sha512sum "$1" | cut -d\ -f1)
if url=$(curl -sf "https://dump.bitcheese.net/search/sha512/$sum?simple" | sed -e 's#http#https#'); then
echo "$url"
else
curl -sw '%{redirect_url}' -F "file=@\"$1\"" https://dump.bitcheese.net/upload-file?simple | sed -e 's#http#https#' | urldecode
echo
}
fi
}
if [[ -n "$1" ]]; then
while [[ -n "$1" ]]; do
up "$1"
shift
done
else
f="`tempfile`"
f="$(mktemp)"
trap 'rm "$f"' EXIT
cat > "$f"
up "$f"

0 comments on commit dde8f6e

Please sign in to comment.
You can’t perform that action at this time.