summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-08-17 07:15:38 +0000
committerpeter <peter@FreeBSD.org>1996-08-17 07:15:38 +0000
commit185f2a7ad372cca07ff1aa1326b795fb00673a61 (patch)
tree228dd953dc4624fe1649113f2a6d57732bccd380 /etc
parent1644aa3579c6bcab5cfe707339ef19d12eb2e56a (diff)
downloadFreeBSD-src-185f2a7ad372cca07ff1aa1326b795fb00673a61.zip
FreeBSD-src-185f2a7ad372cca07ff1aa1326b795fb00673a61.tar.gz
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.
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.local6
1 files changed, 2 insertions, 4 deletions
diff --git a/etc/rc.local b/etc/rc.local
index 84c53c3..77d31cd 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:'
OpenPOWER on IntegriCloud