Browse Source

Fixing upload script once and for all. UncleD forgot to add the string manipulations in his update!

master
Brett Bohnenkamper 6 years ago
parent
commit
3e4a3bc0eb
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      Upload/upload.sh

+ 3
- 0
Upload/upload.sh View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# name: teknik-upload
# creator: KittyKatt
# requires: bash 4.0+, curl

files="$@"
@@ -14,6 +15,8 @@ else
printf "\nUploading file #${n} ... "
out=$(curl -sf -F file="@${i}" http://api.teknik.io/upload/post)
if [[ -n "${out}" ]]; then
out="${out##*name\":\"}"
out="${out%%\"*}"
printf "uploaded! Your file can be found at http://u.teknik.io/${out}\n"
else
printf 'error uploading file!\n'

Loading…
Cancel
Save