#!/bin/csh -f 

if (! $?host) set host = `hostname`

set hmdir = /mit/warlord
cat $hmdir/.project
unset hmdir

if $#argv == 1 then
  set loc = `hostinfo $argv`
  set thishost = $argv
else
  set loc = `hostinfo $host`
  set thishost = $host
endif
set locat = `echo $loc[6] | gawk -F- '{print $1 "-" $2}'`
#echo "locat = $locat"

switch ($locat) 
case 'M11-115':
case 'MONEY.MIT.EDU-': 
case 'FOUNTAIN.MIT.EDU-':  
case 'copilot.MIT.EDU-':
case 'navigator.MIT.EDU-':  
set location = '(Consultants Office) (x3-4435)'
breaksw

case 'bart-savagewood.mit.edu':
case 'bill-the-cat.mit.edu':
case 'bill-the':
case 'binkley.mit.edu-':
case 'bobbi-harlow.mit.edu':
case 'cutter-john.mit.edu':
case 'deathtongue.mit.edu-':
case 'hodge-podge.mit.edu':
case 'limekiller.mit.edu-':
case 'lola-granola.mit.edu':
case 'milquetoast.mit.edu-':
case 'oliver.mit.edu-':
case 'opus.mit.edu-':
case 'pickled-herring.mit.edu':
case 'portnoy.mit.edu-':
case 'quiche-lorraine.mit.edu':
case 'snorkelwacker.mit.edu-':
case 'steve-dallas.mit.edu':
case 'yaz-pistachio.mit.edu':
case 'mary-kay-commandos.mit.edu':
case 'mary-kay':
case 'x15-cruise-basselope.mit.edu':
case 'x15-cruise':
set location = '(SIPB Office) (x3-7788)'
breaksw

case 'm11-113': 
case 'M11-113': 
set location = '(The Fishbowl) (x3-2061)'
breaksw

case 'm11-111': 
case 'M11-111': 
set location = '(One of the dialup servers)'
setenv PRINTER linus
breaksw

case 'm11-116': 
case 'M11-116': 
set location = '(by The Fishbowl) (x3-0187)'
breaksw

case 'm66-080': 
case 'M66-080': 
set location = '(x3-4474)'
breaksw

case 'm1-142': 
case 'M1-142': 
set location = '(x3-2019)'
breaksw

case 'm4-035': 
case 'M4-035': 
set location = '(Basement of bldg. 4) (x3-5660)'
breaksw

case 'm16-034': 
case 'M16-034': 
set location = '(x3-0152)'
breaksw

case 'HEIMDALL.MIT.EDU-':
case 'hal-2000.MIT.EDU-':
case 'elric.MIT.EDU-':
case 'CRASH.MIT.EDU-':
case 'BURN.MIT.EDU-':
case 'Smash.MIT.EDU-':
case 'tabetha.MIT.EDU-':
set location = '(E40 Watchmaker area) (x3-4261)'
breaksw

case 'ODIE.MIT.EDU-':
set location = "(Probe's Office in E40) (x3-0100)"
breaksw

case 'WOMBAT.MIT.EDU-': 
case 'MYCROFT.MIT.EDU-':
set location = "(Ezra's Office in E40) (x3-0119)"
breaksw

case 'm14s-010': 
case 'M14S-010': 
set location = '(Basement of the Science Library) (x3-6190)'
breaksw

case 'M4-167': 
case 'm4-167': 
set location = '(x3-0105)'
breaksw

case 'M2-225':
case 'm2-225': 
set location = '(x3-0106)'
breaksw

case 'w20-575': 
case 'W20-575': 
set location = '(Student Center) (x3-0103)'
breaksw

case 'm37-312': 
case 'M37-312': 
set location = '(Electronic Classroom) (x3-0180)'
breaksw

case 'm37-318': 
case 'M37-318': 
set location = '(Outside the Electronic Classroom) (x3-0179)'
breaksw

case 'm37-332': 
case 'M37-332': 
set location = '(The Way of the Warrior GM cluster)'
breaksw

case 'm37-344': 
case 'M37-344': 
set location = '(x3-4650)'
breaksw

case 'm34-501': 
case 'M34-501': 
set location = '(6.001 & 6.004 Lab) (x3-7976)'
breaksw

case 'M38-344':
case 'm38-344': 
set location = '(EECS Terminal Room) (x3-4650)'
breaksw

endsw

if (! $?location) then
  if (($locat =~ pal*) || ($locat =~ PAL*)) then
    set location = '(6.111 Lab - 38-601) (x3-7350)'
  endif
endif



if (! $?location) then
#echo "locat = $locat"
set location = `ask 10 "unknown" "Derek, where are you? (default home) "`
set loca = `echo $location | gawk '{ print $1 }'`       

if ($loca == 'next') then
        set location = '(Next House cluster) (x3-6775)'
else if ($loca == 'e40') then
        set location = '(E40 Watchmaker area) (x3-4261)'
else if ($loca == 'eecs') then
	set location = '(EECS Terminal Room) (x3-4650)'
else if ($loca == 'sipb') then
        set location = '(SIPB Office) (x3-7788)'
else if ($loca == 'lab') then
        set location = '(Rich Lab: 16-739) (x3-4710)'
else if ($loca == 'sr') then
	set location = '(Media-Lab: E15-345) (x3-0316)'
else if ($loca == 'ss') then
	set location = '(Media-lab: E15-343) (x3-0673)'
else if ($loca == 'garden') then
	set location = '(Media-Lab: E15-344) (x3-0360)'
else if ($loca == 'e15') then
	set location = '(Media-Lab: E15-355) (x3-0312)'
else if ($loca == 'ez') then
        set location = "(Ezra's Office) (x3-0119)"
else if ($loca == 'gza') then
	set location = "(GZA.COM) (374-3700 x233)"
else if ($loca == 'sun') then
	set location = "(Eng.Sun.COM) (508-442-0583)"
else if ($loca == 'arepa') then
	set location = "(Arepa.COM) (679-9722)"
else if ($loca == '') then
	set location = '(by modem from home)'
else if ($loca == 'unknown') then
	set location = ''
else
	set location = '('$loca')'
endif

else
endif

set hmdir = /mit/warlord
echo '*** Present location:' "$thishost" "$location" '***' > $hmdir/.project
unset location locat loc 
cat $hmdir/.project
unset hmdir


