Expand PMF_FN_* macros.
[netbsd-mini2440.git] / etc / rc.d / motd
blob03e1a08d3e65b3e4337b2bfe096a336338480cfd
1 #!/bin/sh
3 # $NetBSD: motd,v 1.8 2002/03/22 04:33:59 thorpej Exp $
6 # PROVIDE: motd
7 # REQUIRE: mountcritremote
8 # BEFORE: LOGIN
10 $_rc_subr_loaded . /etc/rc.subr
12 name="motd"
13 rcvar="update_motd"
14 start_cmd="motd_start"
15 stop_cmd=":"
17 motd_start()
19 # Update kernel info in /etc/motd
20 # Must be done *before* interactive logins are possible
21 # to prevent possible race conditions.
23 echo "Updating motd."
24 if [ ! -f /etc/motd ]; then
25 install -c -o root -g wheel -m 664 /dev/null /etc/motd
27 ( umask 022
28 T=/etc/_motd
29 sysctl -n kern.version | while read i; do echo $i; break; done > $T
30 sed '1{/^NetBSD.*/{d;};};' < /etc/motd >> $T
31 cmp -s $T /etc/motd || cp $T /etc/motd
32 rm -f $T
36 load_rc_config $name
37 run_rc_command "$1"