From 7aa0c3cfd5e97e1f4bbbf684d2371d8ced2d5cf9 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 24 Feb 2015 19:35:03 +0100 Subject: [PATCH 024/310] Let rc.d/motd work with unames other than FreeBSD Obtained from: ElectroBSD --- libexec/rc/rc.d/motd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/motd b/libexec/rc/rc.d/motd index e63973945f9d..05ffc2be47fe 100755 --- a/libexec/rc/rc.d/motd +++ b/libexec/rc/rc.d/motd @@ -46,7 +46,7 @@ motd_start() T=`mktemp -t motd` uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T} - cat "${TEMPLATE}" >> ${T} + awk '{if (NR == 1) {if ($1 == "'"$(uname)"'") {next} else {print "\n"$0}} else {print}}' < "${TEMPLATE}" >> ${T} install -C -o root -g wheel -m "${PERMS}" "$T" "${TARGET}" rm -f "$T" -- 2.37.1