summaryrefslogtreecommitdiff
path: root/etc/rc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-04-18 23:06:51 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-04-18 23:06:51 +0000
commit588b6115cc9e0f7aa7137192fa067608922bc6c9 (patch)
tree6f83c0ce3bbecede1cacfce87f9c7ac618c3e494 /etc/rc
parent943448d845bf5f8e425b0883d9435348c865b8b6 (diff)
Simplify patching of motd(5), also making it agree better with the
documentation if the first line of the file is blank. Quirk reported by Anthony Coulter <bsd at anthonycoulter dot name>. OK rpe@
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc5
1 files changed, 2 insertions, 3 deletions
diff --git a/etc/rc b/etc/rc
index 342c1353740..4ad3909a852 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,4 +1,4 @@
-# $OpenBSD: rc,v 1.493 2017/02/26 16:51:18 matthieu Exp $
+# $OpenBSD: rc,v 1.494 2017/04/18 23:06:50 schwarze Exp $
# System startup script run by init on autoboot or after single-user.
# Output and error are redirected to console by init, and the console is the
@@ -504,8 +504,7 @@ if [[ ! -f /etc/motd ]]; then
fi
if T=$(mktemp /tmp/_motd.XXXXXXXXXX); then
sysctl -n kern.version | sed 1q >$T
- echo "" >>$T
- sed '1,/^$/d' </etc/motd >>$T
+ sed -n '/^$/,$p' </etc/motd >>$T
cmp -s $T /etc/motd || cp $T /etc/motd
rm -f $T
fi