You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 years ago
12345678910111213141516
  1. #!/usr/bin/env bash
  2. #
  3. # pbrisbin 2013 - share a file by hosting it on pbrisbin dot com.
  4. #
  5. ###
  6. [[ "$1" =~ -p|--prefix ]] && { prefix="$2/"; shift 2; }
  7. file="$(readlink -f "$1")"
  8. base="${file##*/}"
  9. link="http://files.pbrisbin.com/$prefix$base"
  10. scp "$file" "pbrisbin.com:/srv/http/files/$prefix$base" || exit $?
  11. [[ -n "$DISPLAY" ]] && printf "$link" | xclip
  12. printf "%s\n" "$link"