#/bin/csh -f
set site=`rsh mailhost hostname`
set date=(`date`)
switch ($site)
  case amiga:
    switch ($date[1])
      case Sun:
      case Tue:
      case Thu:
        echo "West: next outgoing tommorrow night, next incoming tonight"
        breaksw
      case Mon:
      case Wed:
        echo "East: next outgoing tonight, next incoming tommorrow night"
        breaksw
      case Fri:
        echo "East: next outgoing tonight, next incoming Sunday night"
        breaksw
      case Sat:
        echo "West: next outgoing Monday night, next incoming Sunday night"
        breaksw
    endsw
    breaksw
  case ghostwheel:
    switch ($date[1])
      case Sun:
      case Tue:
      case Thu:
        echo "West: next outgoing tonight, next incoming tommorrow night"
        breaksw
      case Mon:
      case Wed:
        echo "East: next outgoing tommorrow night, next incoming tonight"
        breaksw
      case Fri:
        echo "East: next outgoing Sunday night, next incoming tonight"
        breaksw
      case Sat:
        echo "West: next outgoing Sunday night, next incoming Monday night"
    endsw
    breaksw
  default:
    echo "unknown site $site"
    switch ($date[1])
      case Sun:
      case Tue:
      case Thu:
      case Sat:
        echo "West"
        breaksw
      case Mon:
      case Wed:
      case Fri:
        echo "East"
        breaksw
    endsw
endsw
