[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.2

1.1       lukem       1: #!/bin/sh
                      2: #
1.2     ! lukem       3: # $NetBSD: motd,v 1.1.1.1 2000/03/10 11:53:24 lukem Exp $
1.1       lukem       4: #
                      5:
                      6: # PROVIDE: motd
                      7: # REQUIRE: systemfs
                      8:
                      9: . /etc/rc.subr
                     10:
                     11: name="motd"
                     12: start_precmd="checkyesno update_motd"
                     13: start_cmd="motd_start"
                     14: stop_cmd=":"
                     15:
                     16: motd_start()
                     17: {
                     18:        #       Update kernel info in /etc/motd
                     19:        #       Must be done *before* interactive logins are possible
                     20:        #       to prevent possible race conditions.
                     21:        #
                     22:        echo "Updating motd."
                     23:        if [ ! -f /etc/motd ]; then
                     24:                install -c -o root -g wheel -m 664 /dev/null /etc/motd
                     25:        fi
                     26:        T=/etc/_motd
                     27:        rm -f $T
                     28:        sysctl -n kern.version | sed 1q > $T
                     29:        echo "" >> $T
                     30:        sed '1,/^$/d' < /etc/motd >> $T
                     31:        cmp -s $T /etc/motd || cp $T /etc/motd
                     32:        rm -f $T
                     33: }
                     34:
1.2     ! lukem      35: load_rc_config $name
1.1       lukem      36: run_rc_command "$1"

CVSweb <webmaster@jp.NetBSD.org>