sharefile.sh: nuevo script

El objetivo de este script es facilitar compartir archivos en canales de IRC. El script permite subir archivor a los servidores de transfer.sh o a The Null Pointer y porsteriormente generar el link de dicho archivo para poder compartirlo
This commit is contained in:
Tuxliban Torvalds 2023-05-07 13:41:30 -06:00
parent c0f456c86b
commit b7de63ef42
1 changed files with 42 additions and 0 deletions

42
varios/sharefile.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/sh
#
# Dependencias: nnn, xsel
#
# Shell: POSIX compliant
#
# Autor: O. Sánchez <o-sanchez@linuxmail.org>
# Colaboración: Visone-Selektah <https://github.com/Visone-Selektah>
script="${0##*/}"
ayuda() {
printf '%s\n' "\
$script ayuda a explorar en busca de un archivo para compartir a través de
un link en los servidores de The Null Pointer o en transfer.sh
Modo de uso:
$script <servidor>
--null Carga y comparte archivo alojado en el servidor The Null Pointer
--transfer Carga y comparte archivo alojado en el servidor transfer.sh
-h | --help Muestra este mensaje de ayuda
"
}
case $1 in
# The Null Pointer Server
--null)
curl -F "file=@$(nnn -P p -dQs irc -p -)" -F "secret=" https://0x0.st | xsel -b
;;
# transfer.sh Server
--transfer)
files=$(nnn -P p -dQs irc -p -)
curl --upload-file "$files" https://transfer.sh/"${files##/*}" | xsel -b
;;
-h|--help|*)
ayuda
esac