home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume6 / shadow-2.pt3 / motd.c < prev    next >
C/C++ Source or Header  |  1989-02-03  |  429b  |  30 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include "config.h"
  4.  
  5. extern    char    home[];
  6.  
  7. void    motd ()
  8. {
  9. #ifdef    MOTD
  10.     FILE    *fp;
  11.     register int    c;
  12. #ifdef    HUSHLOGIN
  13.     char    hush[BUFSIZ];
  14.  
  15.     (void) strcat (strcpy (hush, home + 5), "/.hushlogin");
  16.  
  17.     if (access (hush, 0) == 0)
  18.         return;
  19. #endif
  20.     if ((fp = fopen ("/etc/motd", "r")) == (FILE *) 0)
  21.         return;
  22.  
  23.     while ((c = getc (fp)) != EOF)
  24.         putchar (c);
  25.  
  26.     fclose (fp);
  27.     fflush (stdout);
  28. #endif
  29. }
  30.