[2218] in Athena Bugs

home help back first fref pref prev next nref lref last post

setting /etc/motd from /etc/rc

daemon@ATHENA.MIT.EDU (geer@ATHENA.MIT.EDU)
Tue May 9 22:28:38 1989

From: <geer@ATHENA.MIT.EDU>
Date: Tue, 9 May 89 22:28:04 EDT
To: bugs@ATHENA.MIT.EDU
where:	RTPC 6.2A & others

what:	/etc/rc cannot reset /etc/motd

why:	/etc/rc relies on /usr/ucb/tail which is not
	available at boot time

fix:	

*** /etc/rc	Wed Apr 26 08:53:37 1989
--- /tmp/rc.new	Tue May  9 22:24:27 1989
***************
*** 374,383 ****
  
  # Put the system version string in /etc/motd
  
! if [ -f /usr/ucb/tail ]; then
  	echo -n "Editing /etc/motd: "				>/dev/console
! 	/usr/ucb/tail -1 /etc/version > /tmp/t1
! 	/usr/ucb/tail +2 /etc/motd >> /tmp/t1
  	mv /tmp/t1 /etc/motd
  	chmod 644 /etc/motd
  	echo "done."						>/dev/console
--- 374,383 ----
  
  # Put the system version string in /etc/motd
  
! if [ -f /bin/awk ]; then
  	echo -n "Editing /etc/motd: "				>/dev/console
! 	/bin/awk '{ prev = $0 } END { print prev }' /etc/version > /tmp/t1
! 	/bin/awk '{ if ( NR > 1 ) print }' /etc/motd >> /tmp/t1
  	mv /tmp/t1 /etc/motd
  	chmod 644 /etc/motd
  	echo "done."						>/dev/console

home help back first fref pref prev next nref lref last post