Update some scripts

This commit is contained in:
2024-02-24 00:21:04 +01:00
parent 3cd7b9bfaf
commit 1d62cd3a86
6 changed files with 92 additions and 72 deletions

View File

@@ -1,4 +1,4 @@
# /bin/bash
#!/bin/bash
# Script: check_http_status.sh
# Descripción: Este script verifica el código de estado HTTP de una o varias URL.
@@ -14,8 +14,9 @@ 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
echo -e "${COLOR_RED}\n\n[!] Saliendo... \n${COLOR_RESET}"
tput cnorm
exit 1
}
# Ctrl+C
@@ -33,7 +34,7 @@ if [ "${1##*.}" == "txt" ]; then
# Si se proporciona un archivo de texto, leer las URL y verificar los códigos de estado HTTP
while read -r line; do
verificar_codigo_estado "$line"
done < "$1"
done <"$1"
else
# Si se proporciona una URL directamente, verificar el código de estado HTTP
verificar_codigo_estado "$1"