7 # REQUIRE: mountcritremote
13 desc="Update /etc/motd"
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 check_startmsgs && 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
46 check_startmsgs && echo '.'