[24462] in Source-Commits
/svn/athena r24053 - in trunk/athena/bin/machtype: . debian
daemon@ATHENA.MIT.EDU (Evan Broder)
Mon Oct 5 15:31:19 2009
Date: Mon, 5 Oct 2009 15:31:05 -0400
From: Evan Broder <broder@MIT.EDU>
Message-Id: <200910051931.n95JV5Q4017779@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: broder
Date: 2009-10-05 15:31:05 -0400 (Mon, 05 Oct 2009)
New Revision: 24053
Modified:
trunk/athena/bin/machtype/debian/changelog
trunk/athena/bin/machtype/machtype.1
trunk/athena/bin/machtype/machtype_linux.sh
Log:
In machtype:
* Add machtype -q, which outputs whether or not a workstation is a
quickstation.
Modified: trunk/athena/bin/machtype/debian/changelog
===================================================================
--- trunk/athena/bin/machtype/debian/changelog 2009-10-05 15:10:13 UTC (rev 24052)
+++ trunk/athena/bin/machtype/debian/changelog 2009-10-05 19:31:05 UTC (rev 24053)
@@ -1,3 +1,10 @@
+debathena-machtype (10.0.2-0debathena1) unstable; urgency=low
+
+ * Add machtype -q, which outputs whether or not a workstation is a
+ quickstation.
+
+ -- Evan Broder <broder@mit.edu> Mon, 05 Oct 2009 15:12:58 -0400
+
debathena-machtype (10.0.1-0debathena5) unstable; urgency=low
* Don't make the inability to successfully run fs (e.g., if AFS hasn't
Modified: trunk/athena/bin/machtype/machtype.1
===================================================================
--- trunk/athena/bin/machtype/machtype.1 2009-10-05 15:10:13 UTC (rev 24052)
+++ trunk/athena/bin/machtype/machtype.1 2009-10-05 19:31:05 UTC (rev 24053)
@@ -5,7 +5,7 @@
machtype \- Print machine type to standard output
.SH SYNOPSIS
.B machtype
-[-c] [-d] [-r] [-M] [-v] [-A] [-L] [-P] [-N] [-E] [-S] [-C]
+[-c] [-d] [-r] [-M] [-v] [-A] [-L] [-P] [-N] [-E] [-S] [-C] [-q]
.SH DESCRIPTION
.I Machtype
prints the CPU type to standard output. It prints "sun4" when run on a
@@ -63,6 +63,10 @@
stored in the environment variable ATHENA_SYS_COMPAT, and is used by
\fIathdir\fR(1) and \fIadd\fR(1) as a set of fallback values when a
locker doesn't have binaries for the actual Athena System name.
+.TP
+.B -q
+Print out "quickstation" if the workstation is a quickstation and
+"not_quickstation" if it is not.
.PP
.I Machtype
is useful for conditionalizing shell scripts, .login files, etc. in an
Modified: trunk/athena/bin/machtype/machtype_linux.sh
===================================================================
--- trunk/athena/bin/machtype/machtype_linux.sh 2009-10-05 15:10:13 UTC (rev 24052)
+++ trunk/athena/bin/machtype/machtype_linux.sh 2009-10-05 19:31:05 UTC (rev 24053)
@@ -18,10 +18,12 @@
# -N : print out the name of the base OS
# -P : print out Athena System packs (from /srvd/.rvdinfo)
# -S : Print out the Athena System name
+# -q : Print out "quickstation" or "not_quickstation" depending on if this
+# workstation is a quickstation or not
PATH=/bin:/usr/bin:/sbin:/usr/sbin
-while getopts cdk:m:rvACELMNPS i; do
+while getopts cdk:m:rvACELMNPSq i; do
case "$i" in
c)
cpu=1
@@ -69,6 +71,9 @@
S)
ath_sys_name=1
;;
+ q)
+ quickstation=1
+ ;;
\?)
echo "Usage: machtype [-cdrvACELMNPS]" 1>&2
exit 1
@@ -165,6 +170,17 @@
printed=1
fi
+if [ $quickstation ]; then
+ if (mount | grep -q '^AFS on /afs' &&
+ grep -Fxqi "$(hostname --fqdn)" /afs/athena.mit.edu/system/config/quick/quickstations) ||
+ [ "$FORCE_QUICKSTATION" = 1 ]; then
+ echo quickstation
+ else
+ echo not_quickstation
+ fi
+ printed=1
+fi
+
if [ $printed -eq '0' ] ; then
echo linux
fi