Skip to content

Commit

Permalink
Removed the check for the existence of the mail client binary if the …
Browse files Browse the repository at this point in the history
…script does not use mail notification.

Signed-off-by: vlad11 <[email protected]>
  • Loading branch information
click0 committed Jan 13, 2023
1 parent ce5713a commit af637b0
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions domain-check-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
# Author: Matty < matty91 at gmail dot com >
# Co-author: Vladislav V. Prodan <github.com/click0>
#
# Current Version: 2.62
# Last Updated: 05-Jan-2023
# Current Version: 2.63
# Last Updated: 13-Jan-2023
#
# Revision History:
#
# Version 2.63
# Removed the check for the existence of the mail client binary if the script does not use mail notification.
#
# Version 2.62
# Added support for .bm domain -- Vladislav V. Prodan <github.com/click0>
#
Expand Down Expand Up @@ -354,7 +357,7 @@ VERBOSE="FALSE"
WHOIS_SERVER="whois.iana.org"

# Location of system binaries
for BINARY in whois date mail curl ; do
for BINARY in whois date curl ; do
if [ ! -x "$(command -v $BINARY)" ]; then
echo "ERROR: The $BINARY binary does not exist in \$$BINARY."
echo " FIX: Please modify the \$$BINARY variable in the program header."
Expand All @@ -368,7 +371,6 @@ DATE=$(command -v date)
CUT=$(command -v cut)
GREP=$(command -v grep)
TR=$(command -v tr)
MAIL=$(command -v mail)
CURL=$(command -v curl)
ECHO=$(command -v echo)
HEAD=$(command -v head)
Expand Down Expand Up @@ -1118,6 +1120,20 @@ do
esac
done

### Checking for the existence of a mail client
if [ "${ALARM}" == "TRUE" ]
then
for BINARY in mail ; do
if [ ! -x "$(command -v mail)" ]; then
echo "ERROR: The $BINARY binary does not exist in \$$BINARY."
echo " FIX: Please modify the \$$BINARY variable in the program header."
exit 1
fi
done
MAIL=$(command -v mail)
fi


### Show debug information when running script
if [ "${VERBOSE}" == "TRUE" ]
then
Expand Down

0 comments on commit af637b0

Please sign in to comment.