Add colour to result

This commit is contained in:
MeaTLoTioN 2023-11-24 09:43:05 +00:00
parent c92ef722bd
commit 51995eae62

View File

@ -7,10 +7,7 @@ usage() {
case $2 in
[yY][eE][sS]|[tT][rR][uU][eE]|1) DEBUG=true;;
esac
COUNT=0
DEPTH=0
mDEPTH=0
INDENT=2
COUNT=0;DEPTH=0;mDEPTH=0;INDENT=2;
checkIncludes() {
SPF=$1
for I in $(dig -t txt $SPF +short|grep -oE "include:.* |ip[4,6]:.* "|sed 's/include://g; s/ip[4,6]://g; s/\"//g'|tr ' ' '\n'); do
@ -26,4 +23,10 @@ checkIncludes() {
}
checkIncludes $DOMAIN
[[ $DEBUG ]] && echo
echo "Total: $COUNT (Max lookups: $mDEPTH)"
GRN="";YEL="";RED="";NOCOL="";
case $mDEPTH in
[1-7]) SCOL="${GRN}";;
[8-9]) SCOL="${YEL}";;
*) SCOL="${RED}";;
esac
echo "${SCOL}Total: $COUNT (Max lookups: $mDEPTH)${NOCOL}"