From baeda13edd14a65599179267448ed141e4f2cefd Mon Sep 17 00:00:00 2001 From: Bruno21 Date: Sat, 2 Nov 2024 12:53:06 +0100 Subject: [PATCH] hosts list array in source code or external file --- validity.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/validity.sh b/validity.sh index 12b2c8c..1ea3a88 100755 --- a/validity.sh +++ b/validity.sh @@ -46,11 +46,14 @@ ScriptArgs=( "$@" ) ScriptPath="$(readlink -f "$0")" # /Users/bruno/Documents/Scripts/bashbirds/bashbirds.sh ScriptWorkDir="$(dirname "$ScriptPath")" # /Users/bruno/Documents/Scripts/bashbirds -# Domains to check +### Domains to check ### #hosts=("domain.com") -if [ -f "$ScriptWorkDir/validity_domains.txt" ]; then - readarray -t hosts < "$ScriptWorkDir/validity_domains.txt" -else echo -e "${red}No domain to check !${reset}" +hosts=("") +if [ ${#hosts[@]} -eq 0 ]; then + if [ -f "$ScriptWorkDir/validity_domains.txt" ]; then + readarray -t hosts < "$ScriptWorkDir/validity_domains.txt" + else echo -e "${red}No domain to check !${reset}" + fi fi port=443 # Days left before notification