#!/bin/sh ## Adapted from https://gist.github.com/nl5887/a511f172d3fb3cd0e42d. # # Defines transfer alias and provides easy command line file and folder sharing. # # Authors: # Remco Verhoef # curl --version 2>&1 > /dev/null if [ $? -ne 0 ]; then echo "Could not find curl." exit 1 fi # check arguments if [ $# -eq 0 ]; then cat<> $zipfile curl --progress-bar --upload-file "$zipfile" "https://transfer.sh/$basefile.zip" >> $tmpfile rm -f $zipfile else # transfer file curl --progress-bar --upload-file "$file" "https://transfer.sh/$basefile" >> $tmpfile fi else # transfer pipe curl --progress-bar --upload-file "-" "https://transfer.sh/$file" >> $tmpfile fi # cat output link cat $tmpfile # cleanup rm -f $tmpfile