home *** CD-ROM | disk | FTP | other *** search
/ ftp.eterna.com.au / 2014.06.ftp.eterna.com.au.tar / ftp.eterna.com.au / pub / rc.d.tar.gz / rc.d.tar / rc.d / motd < prev    next >
Text File  |  1998-09-23  |  486b  |  22 lines

  1. #! /bin/sh
  2.  
  3. # PROVIDE: motd
  4. # REQUIRE: mountall
  5.  
  6. # Update kernel info in /etc/motd
  7. # Must be done *before* interactive logins are possible to prevent
  8. # possible race conditions.
  9. if checkyesno update_motd; then
  10.     echo 'updating motd.'
  11.     if [ ! -f /etc/motd ]; then
  12.         install -c -o root -g wheel -m 664 /dev/null /etc/motd
  13.     fi
  14.     T=/tmp/_motd
  15.     rm -f $T
  16.     sysctl -n kern.version | sed 1q > $T
  17.     echo "" >> $T
  18.     sed '1,/^$/d' < /etc/motd >> $T
  19.     cmp -s $T /etc/motd || cp $T /etc/motd
  20.     rm -f $T
  21. fi
  22.