scripts-random/01_bash/open-list-url.sh

36 lines
788 B
Bash
Raw Permalink Normal View History

2024-02-22 21:02:37 +01:00
#!/bin/bash
# Script: open-list-url.sh
# Descripción: El script actual se encarga de leer un archivo de enlaces línea
# por línea y abrir cada enlace utilizando el navegador web Firefox.
# Author: Manuel Vergara
# Web: https://vergaracarmona.es
#
COLOR_RED='\033[0;31m'
COLOR_RESET='\033[0m'
# Control de salida con Ctrl + C
function ctrl_c() {
echo -e "${COLOR_RED}\n\n[!] Saliendo... \n${COLOR_RESET}"
tput cnorm
exit 1
}
# Ctrl+C
trap ctrl_c SIGINT
# Si se proporciona el archivo de enlaces como argumento
if [ $# -eq 0 ]; then
echo "Uso: $0 archivo_enlaces.txt"
exit 1
fi
# Lee el archivo de enlaces línea por línea y abre cada enlace
while IFS= read -r enlace; do
echo "Abriendo enlace: $enlace"
firefox "$enlace"
done <"$1"
echo "Proceso completado."