[Logcheck-commits] CVS logcheck/src

CVS User jlps-guest logcheck-devel@lists.alioth.debian.org
Mon, 09 May 2005 01:12:03 +0000


Update of /cvsroot/logcheck/logcheck/src
In directory haydn:/tmp/cvs-serv23272

Modified Files:
	logcheck 
Log Message:
Set a default for FQDN and only set the value of HOSTNAME once we've read logcheck.conf


--- /cvsroot/logcheck/logcheck/src/logcheck	2005/04/20 14:25:08	1.116
+++ /cvsroot/logcheck/logcheck/src/logcheck	2005/05/09 01:12:02	1.117
@@ -22,7 +22,7 @@
 # along with Logcheck; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-# $Id: logcheck,v 1.116 2005/04/20 14:25:08 maks-guest Exp $
+# $Id: logcheck,v 1.117 2005/05/09 01:12:02 jlps-guest Exp $
 
 if [ $UID == 0 ]; then
     echo "logcheck should not be run as root. Use su to invoke logcheck:"
@@ -44,13 +44,6 @@
 GETOPTS="c:dhH:l:L:m:opr:RsS:tTuvw"
 
 # Get the details for the email message
-# Hostname either fully qualified or not.
-if [ -z "$FQDN" ]; then
-    HOSTNAME="$(hostname --short)"
-else
-    HOSTNAME="$(hostname --fqdn)"    
-fi
-
 DATE="$(date +'%Y-%m-%d %H:%M')"
 VERSION="1.2.40"
 
@@ -78,6 +71,7 @@
 MAILOUT=0
 NOCLEANUP=0
 REBOOT=0
+FQDN=0
 SORTUNIQ=0
 SUPPORT_CRACKING_IGNORE=0
 SYSLOGSUMMARY=0
@@ -515,6 +509,13 @@
     SORT="sort -k 1,3 -s"
 fi
 
+# Hostname either fully qualified or not.
+if [ $FQDN -eq 1 ]; then
+        HOSTNAME="$(hostname --fqdn)"
+else
+        HOSTNAME="$(hostname --short)"
+fi
+		
 # Now check for the other options
 while getopts $GETOPTS opt; do
     case "$opt" in