7 # REQUIRE: mountcritremote
14 start_cmd="motd_start"
21 # Update kernel info in /etc/motd
22 # Must be done *before* interactive logins are possible
23 # to prevent possible race conditions.
25 check_startmsgs && echo -n 'Updating motd:'
26 if [ ! -f /etc/motd ]; then
27 install -c -o root -g wheel -m ${PERMS} /dev/null /etc/motd
30 if [ ! -w /etc/motd ]; then
31 echo ' /etc/motd is not writable, update failed.'
36 uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T}
37 awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T}
39 cmp -s $T /etc/motd || {
41 chmod ${PERMS} /etc/motd
45 check_startmsgs && echo '.'