diff --git a/defaults.inc b/defaults.inc index c694ddb..44d9997 100755 --- a/defaults.inc +++ b/defaults.inc @@ -31,9 +31,10 @@ else fi SENDNOTICE(){ + [ -n ${NM_HOSTNAMES[${RNIP}]} ] && shost=${NM_HOSTNAMES[${RNIP}]} || shost=$(hostname -f) [ "${PUSHOVER_APP_TOKEN}" != "" ] && PUSH_TO_MOBILE "${2} -$(date)" "${1}" ${3} & +[${shost}] $(date)" "${1}" ${3} & [ "${EMAIL_NOTICE}" != "" ] && echo -e "${2}\n\n$(date)" | mail -s "${1}" ${EMAIL_NOTICE}