diff --git a/update-ngxblocker b/update-ngxblocker index 186a513d7..0f15af31d 100755 --- a/update-ngxblocker +++ b/update-ngxblocker @@ -53,7 +53,7 @@ Usage: $script [OPTIONS] [ -b ] : NGINX bots directory (default: $BOTS_DIR) [ -i ] : Change installer path (default: $INSTALLER) [ -r ] : Change repo url (default: $REPO) - [ -e ] : Change email address (default: $EMAIL) + [ -m ] : Change email address (default: $EMAIL) [ -n ] : Do not send email report (default: $SEND_EMAIL) [ -v ] : Print blacklist version [ -h ] : this help message @@ -194,8 +194,8 @@ check_args() { } check_mail_depends() { - if [ ! -f /usr/bin/mail ]; then # mailx + ssmtp are enough to send emails - printf "${BOLDYELLOW}WARN${RESET}: missing /usr/bin/mail => ${BOLDWHITE}disabling emails${RESET}.\n\n" + if [ ! -f /usr/bin/mail ] && [ ! -f /bin/mail ]; then # mailx + ssmtp are enough to send emails + printf "${BOLDYELLOW}WARN${RESET}: missing mail command => ${BOLDWHITE}disabling emails${RESET}.\n\n" SEND_EMAIL="N" fi } @@ -223,7 +223,7 @@ check_depends() { get_options() { local arg= opts= - while getopts :c:b:u:r:e:nvh opts "$@" + while getopts :c:b:u:r:e:m:nvh opts "$@" do if [ -n "${OPTARG}" ]; then case "$opts" in @@ -239,6 +239,7 @@ get_options() { i) INSTALLER=$arg; check_args $opts script $arg ;; r) REPO=$arg; check_args $opts url $arg ;; e) EMAIL=$arg; check_args $opts email $arg ;; + m) EMAIL=$arg; check_args $opts email $arg ;; n) SEND_EMAIL=N ;; v) check_depends; check_version ;; h) usage ;;