[BACK]Return to motd CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / rc.d

Annotation of src/etc/rc.d/motd, Revision 1.9

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

CVSweb <webmaster@jp.NetBSD.org>