home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / sun / admin / 9617 < prev    next >
Encoding:
Text File  |  1992-12-21  |  2.3 KB  |  63 lines

  1. Newsgroups: comp.sys.sun.admin
  2. Path: sparky!uunet!gumby!ursa!ursa!mjr
  3. From: mjr@ursa.calvin.edu (Matt Ranney)
  4. Subject: Re: how to force readers to read a system message?
  5. Message-ID: <mjr.724807771@ursa>
  6. Sender: news@calvin.edu
  7. Organization: Calvin College
  8. References: <15DEC92.09272432@cc4.crl.aecl.ca>
  9. Date: Sat, 19 Dec 1992 23:29:31 GMT
  10. Lines: 51
  11.  
  12. roihar@cc4.crl.aecl.ca writes:
  13.  
  14. >Has anyone out there figured out how to do this yet??
  15. >I find that anything in /etc/motd is generally ignored by
  16. >at least 80% of our users. If we make them hit carriage return
  17. >or something similar after reading the message they generally
  18. >ignore the message and hit carriage return. Perhaps a quiz
  19. >on the contents of the message displayed? When will the system
  20. >be going down? Why is the system going down? Who is your Lord
  21. >and Master? What is your Bell Calling card number? etc...
  22. >Any ideas would be gratefully appreciated.
  23.  
  24. Your quota will be reduced for each incorrect answer.
  25.  
  26. Here is what I use to sorta deal with this problem.  Most people know
  27. that if they put a .hushlogin file in their home directory that they
  28. won't see the motd.  Also, just about everybody here uses tcsh as
  29. their login shell, so I added the followin lines to /etc/csh.login:
  30.  
  31. --------------------------------------
  32. # If the user has ~/.hushlogin file, then they won't see the motd
  33. # automatically.  Use ls -t to check which file is newer, and if 
  34. # /etc/motd is newer, then print it out and reset the date on the
  35. # .hushlogin file.  If the message is newer, print the info in a 
  36. # way the the user will see it.  (blinking + bold)
  37. #
  38. if ( -e $home/.hushlogin ) then
  39.         set tim=`ls -t ~/.hushlogin /etc/motd`
  40.         if ($tim[1] == "/etc/motd") then
  41.         echotc -s mb        
  42.                 echo --- NEW MOTD ---
  43.         echotc -s me
  44.         echotc -s so
  45.                 cat /etc/motd
  46.         echotc -s se
  47.         touch ~/.hushlogin
  48.         else
  49.                 echo motd is unchanged.
  50.         endif
  51.     unset tim
  52. endif
  53. ---------------------------------
  54.  
  55. I abhor csh programming, so there might be a cleaner way of doing
  56. this, but this works fine for me.  Of course, if they don't have a
  57. .hushlogin file, it won't work, but you could always just go and GIVE
  58. everybody one, I guess.
  59. --
  60. Matt Ranney -  mjr@calvin.edu
  61.   "You know, I don't think theres a man, woman, or child alive today
  62.    who doesn't enjoy a lovely beverage."  -DL
  63.