[24041] in Source-Commits
/svn/athena r23648 - trunk/athena/bin/bugme
daemon@ATHENA.MIT.EDU (Evan Broder)
Sat Mar 28 13:58:21 2009
Date: Sat, 28 Mar 2009 13:58:12 -0400
From: Evan Broder <broder@MIT.EDU>
Message-Id: <200903281758.n2SHwCRa031057@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: broder
Date: 2009-03-28 13:58:12 -0400 (Sat, 28 Mar 2009)
New Revision: 23648
Modified:
trunk/athena/bin/bugme/bugme.xsession
Log:
In bugme, use awk instead of grep to anchor the beginning and the end
hostname, and to also ignore any metacharacters that might show up in
the hostname.
Modified: trunk/athena/bin/bugme/bugme.xsession
===================================================================
--- trunk/athena/bin/bugme/bugme.xsession 2009-03-27 23:34:37 UTC (rev 23647)
+++ trunk/athena/bin/bugme/bugme.xsession 2009-03-28 17:58:12 UTC (rev 23648)
@@ -1,6 +1,9 @@
: ${FORCE_QUICKSTATION=0}
-grep -iq $(hostname --fqdn) /afs/athena/system/config/quick/quickstations
+# Use IGNORECASE to make the match case insensitive
+# Use ret to set a default exit code, and then override it if there's
+# a match
+awk -v IGNORECASE=1 -v host="$(hostname --fqdn)" -v ret=1 '$0 == host { ret=0 } END { exit ret }' /afs/athena.mit.edu/system/config/quick/quickstations
if [ $? -eq 0 -o $FORCE_QUICKSTATION -eq 1 ] && [ -x /usr/bin/bugme ]; then
STARTUP="/usr/bin/bugme $STARTUP"
fi