My build of nnn with minor changes
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

upload 962 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env sh
  2. # Description: Upload to Firefox Send if ffsend is found, else
  3. # Paste contents of a text a file http://ix.io
  4. # Upload a binary file to file.io
  5. # Dependencies: ffsend (https://github.com/timvisee/ffsend), curl, jq, tr
  6. # Note: Binary file set to expire after a week
  7. #
  8. # Shell: POSIX compliant
  9. # Author: Arun Prakash Jana
  10. if ! [ -z "$1" ] && [ -s "$1" ]; then
  11. if which ffsend >/dev/null 2>&1; then
  12. ffsend -iq u "$1"
  13. elif [ "$(mimetype --output-format %m "$1" | awk -F '/' '{print $1}')" = "text" ]; then
  14. curl -F "f:1=@$1" ix.io
  15. else
  16. # Upload the file, show the download link and wait till user presses any key
  17. curl -s -F "file=@$1" https://file.io/?expires=1w | jq '.link' | tr -d '"'
  18. # To write download link to "$1".loc and exit
  19. # curl -s -F "file=@$1" https://file.io/?expires=1w -o `basename "$1"`.loc
  20. fi
  21. else
  22. printf "empty file!"
  23. fi
  24. read -r _