Diff for /embedaddon/smartmontools/smartd_warning.sh.in between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2013/07/22 01:17:36 version 1.1.1.2, 2013/10/14 07:54:04
Line 45  Usage: Line 45  Usage:
   export SMARTD_MESSAGE='Error Message'    export SMARTD_MESSAGE='Error Message'
   export SMARTD_FAILTYPE='Type of failure, "EMailTest" for tests'    export SMARTD_FAILTYPE='Type of failure, "EMailTest" for tests'
   export SMARTD_TFIRST='Date of first message sent, empty if none'    export SMARTD_TFIRST='Date of first message sent, empty if none'
  export SMARTD_TFIRSTEPOCH='time_t format of above'  #export SMARTD_TFIRSTEPOCH='time_t format of above'
   export SMARTD_PREVCNT='Number of previous messages, 0 if none'    export SMARTD_PREVCNT='Number of previous messages, 0 if none'
   export SMARTD_NEXTDAYS='Number of days until next message, empty if none'    export SMARTD_NEXTDAYS='Number of days until next message, empty if none'
   export SMARTD_DEVICEINFO='Device identify information'    export SMARTD_DEVICEINFO='Device identify information'
Line 63  if [ -z "${SMARTD_ADDRESS}${SMARTD_MAILER}" ]; then Line 63  if [ -z "${SMARTD_ADDRESS}${SMARTD_MAILER}" ]; then
 fi  fi
   
 # Get host and domain names  # Get host and domain names
for cmd in 'hostname' 'uname -n' 'echo "${HOSTNAME?unset}"' 'echo "[Unknown]"'; dofor cmd in @os_hostname@ 'echo "[Unknown]"'; do
   hostname=`eval $cmd 2>/dev/null` || continue    hostname=`eval $cmd 2>/dev/null` || continue
   test -n "$hostname" || continue    test -n "$hostname" || continue
   break    break
Line 71  done Line 71  done
   
 dnsdomain=${hostname#*.}  dnsdomain=${hostname#*.}
 if [ "$dnsdomain" != "$hostname" ]; then  if [ "$dnsdomain" != "$hostname" ]; then
  # BSD 'hostname' prints FQDN  # hostname command printed FQDN
   hostname=${hostname%%.*}    hostname=${hostname%%.*}
 else  else
  #           Linux           Cygwin  for cmd in @os_dnsdomainname@ 'echo'; do
  for cmd in 'dnsdomainname' 'echo "${USERDNSDOMAIN?unset}"' 'echo'; do 
     dnsdomain=`eval $cmd 2>/dev/null` || continue      dnsdomain=`eval $cmd 2>/dev/null` || continue
     break      break
   done    done
     test "$dnsdomain" != "(none)" || dnsdomain=
 fi  fi
   
for cmd in 'nisdomainname' 'ypdomainname' 'domainname' 'echo'; dofor cmd in @os_nisdomainname@ 'echo'; do
   nisdomain=`eval $cmd 2>/dev/null` || continue    nisdomain=`eval $cmd 2>/dev/null` || continue
   break    break
 done  done
 test "$nisdomain" != "(none)" || nisdomain=  test "$nisdomain" != "(none)" || nisdomain=
   
 case $OS in  
   Windows*) windomain=$USERDOMAIN ;;  
   *)        windomain= ;;  
 esac  
   
 # Format subject  # Format subject
 export SMARTD_SUBJECT="SMART error (${SMARTD_FAILTYPE-[SMARTD_FAILTYPE]}) detected on host: $hostname"  export SMARTD_SUBJECT="SMART error (${SMARTD_FAILTYPE-[SMARTD_FAILTYPE]}) detected on host: $hostname"
   
Line 103  fullmessage=` Line 98  fullmessage=`
   echo "   DNS domain: ${dnsdomain:-[Empty]}"    echo "   DNS domain: ${dnsdomain:-[Empty]}"
   test -z "$nisdomain" ||    test -z "$nisdomain" ||
     echo "   NIS domain: $nisdomain"      echo "   NIS domain: $nisdomain"
  test -z "$windomain" ||  @OS_WIN32_TRUE@test -z "$USERDOMAIN" ||
    echo "   Win domain: $windomain"  @OS_WIN32_TRUE@  echo "   Win domain: $USERDOMAIN"
   echo    echo
   echo "The following warning/error was logged by the smartd daemon:"    echo "The following warning/error was logged by the smartd daemon:"
   echo    echo

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>