From e0d239dba3a5f667885dc69966f205e859448ec6 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sat, 17 Aug 1996 07:15:38 +0000 Subject: [PATCH] Put on my flame-proof suit and attempt to make the /etc/motd banner editor safer. The old one was too deadly, if the blank line after the "FreeBSD" version banner was missing, it would delete from the beginning of the file up until the next blank line, possibly to the end of file. This was not good. --- etc/rc.local | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/etc/rc.local b/etc/rc.local index 84c53c389655..77d31cd4c544 100644 --- a/etc/rc.local +++ b/etc/rc.local @@ -1,18 +1,16 @@ # # site-specific startup actions, daemons # -# $Id: rc.local,v 1.18 1995/03/30 06:26:10 rgrimes Exp $ +# $Id: rc.local,v 1.19 1995/03/30 06:34:46 rgrimes Exp $ # T=/tmp/_motd rm -f $T uname -v | sed -e 's,^\([^#]*\) #\(.*199[0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > $T -echo "" >> $T -sed '1,/^$/d' < /etc/motd >> $T +awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> $T cp $T /etc/motd chmod 644 /etc/motd rm -f $T -_HOST=`hostname` echo -n 'starting local daemons:'