/* Copyright (c) 2001 by SoftIntegration, Inc. All Rights Reserved */
// Purpose:   If ch is used as a login shell,
//            chslogin and ~/.chslogin will be executed 
//            after execution of chsrc, adminshrc, and ~/.chsrc. 
//            copy this file to your home directory as .chslogin
// Note: (1) The mode of this file .chslogin 
//           should be set to readable 
//#########################################################
#include <stdio.h>
FILE *stream;

/***** get tty and term type ******/
#if defined(_SUN_) || defined(_SOLARIS_)
  putenv("OPENWINHOME=/usr/openwin");
  if(!strcmp(`tty`, "/dev/console") || !strcmp(getenv("TERM"),"sun"))
  {
    printf("\n\n\nStarting OpenWindows in 5 seconds (type Control-C to interrupt)\n");
    sleep 5 
    openwin
    clear            // get rid of annoying cursor rectangle
  }
#elif defined(_LINUX_)
  if(!strcmp(`tty`, "/dev/console") || !strcmp(getenv("TERM"),"linux"))
  {
    printf("\n\n\nStarting X-Windows in 5 seconds (type Control-C to interrupt)\n");
    sleep 5 
    startx
  }
#endif 
_
