3 # $NetBSD: motd,v 1.5 2000/09/19 13:04:38 lukem Exp $
8 # REQUIRE: mountcritremote
15 start_cmd="motd_start"
22 # Update kernel info in /etc/motd
23 # Must be done *before* interactive logins are possible
24 # to prevent possible race conditions.
26 echo -n 'Updating motd'
27 if [ ! -f /etc/motd ]; then
28 install -c -o root -g wheel -m ${PERMS} /dev/null /etc/motd
31 if [ ! -w /etc/motd ]; then
32 echo ' ... /etc/motd is not writable, update failed.'
37 uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T}
38 awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T}
40 cmp -s $T /etc/motd || {
42 chmod ${PERMS} /etc/motd