3 # $NetBSD: motd,v 1.5 2000/09/19 13:04:38 lukem Exp $
4 # $FreeBSD: src/etc/rc.d/motd,v 1.6 2003/06/30 22:06:26 mtm Exp $
5 # $DragonFly: src/etc/rc.d/motd,v 1.4 2003/12/12 16:03:48 eirikn Exp $
9 # REQUIRE: mountcritremote
11 # KEYWORD: DragonFly FreeBSD NetBSD
17 start_cmd="motd_start"
34 # Update kernel info in /etc/motd
35 # Must be done *before* interactive logins are possible
36 # to prevent possible race conditions.
39 if [ ! -f /etc/motd ]; then
40 install -c -o root -g wheel -m ${PERMS} /dev/null /etc/motd
46 uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T}
47 awk '{if (NR == 1) {if ($1 == "DragonFly") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T}
51 uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T}
52 awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T}
56 sysctl -n kern.version | while read i; do echo $i; break; done > $T
57 sed '1{/^NetBSD.*/{d;};};' < /etc/motd >> $T
60 cmp -s $T /etc/motd || {
62 chmod ${PERMS} /etc/motd