[26362] in Source-Commits
/svn/athena r25537 - in trunk/athena/bin/machtype: . debian
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Wed May 30 15:58:00 2012
Date: Wed, 30 May 2012 15:57:59 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201205301957.q4UJvxKd001069@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: jdreed
Date: 2012-05-30 15:57:58 -0400 (Wed, 30 May 2012)
New Revision: 25537
Modified:
trunk/athena/bin/machtype/debian/changelog
trunk/athena/bin/machtype/machtype_linux.sh
Log:
In machtype:
* hostname -f can fail and grep -Fqxi '' can return true
* define the quickstation file at the top
Modified: trunk/athena/bin/machtype/debian/changelog
===================================================================
--- trunk/athena/bin/machtype/debian/changelog 2012-05-30 18:41:23 UTC (rev 25536)
+++ trunk/athena/bin/machtype/debian/changelog 2012-05-30 19:57:58 UTC (rev 25537)
@@ -1,3 +1,10 @@
+debathena-machtype (10.0.2-0debathena7) unstable; urgency=low
+
+ * hostname -f can fail and grep -Fqxi '' can return true
+ * define the quickstation file at the top
+
+ -- Jonathan Reed <jdreed@mit.edu> Wed, 30 May 2012 15:57:54 -0400
+
debathena-machtype (10.0.2-0debathena6) unstable; urgency=low
* Support Ubuntu 12.04.
Modified: trunk/athena/bin/machtype/machtype_linux.sh
===================================================================
--- trunk/athena/bin/machtype/machtype_linux.sh 2012-05-30 18:41:23 UTC (rev 25536)
+++ trunk/athena/bin/machtype/machtype_linux.sh 2012-05-30 19:57:58 UTC (rev 25537)
@@ -22,6 +22,7 @@
# workstation is a quickstation or not
PATH=/bin:/usr/bin:/sbin:/usr/sbin
+QUICKSTATION_FILE=/afs/athena.mit.edu/system/config/quick/quickstations
while getopts cdk:m:rvACELMNPSq i; do
case "$i" in
@@ -171,8 +172,11 @@
fi
if [ $quickstation ]; then
- if (mount | grep -q '^AFS on /afs' &&
- grep -Fxqi "$(hostname --fqdn)" /afs/athena.mit.edu/system/config/quick/quickstations) ||
+ hostname=$(hostname -f)
+ if ( [ -n "$hostname" ] &&
+ [ -e "$QUICKSTATION_FILE" ] &&
+ mount | grep -q '^AFS on /afs' &&
+ grep -Fxqi "$hostname" "$QUICKSTATION_FILE") ||
[ "$FORCE_QUICKSTATION" = 1 ]; then
echo quickstation
else