My build of nnn with minor changes
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

29 rindas
962 B

  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 _