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

1.1     ! lukem       1: #!/bin/sh
        !             2: #
        !             3: # $NetBSD$
        !             4: #
        !             5:
        !             6: # PROVIDE: motd
        !             7: # REQUIRE: systemfs
        !             8:
        !             9: . /etc/rc.subr
        !            10: . /etc/rc.conf
        !            11:
        !            12: name="motd"
        !            13: start_precmd="checkyesno update_motd"
        !            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
        !            27:        T=/etc/_motd
        !            28:        rm -f $T
        !            29:        sysctl -n kern.version | sed 1q > $T
        !            30:        echo "" >> $T
        !            31:        sed '1,/^$/d' < /etc/motd >> $T
        !            32:        cmp -s $T /etc/motd || cp $T /etc/motd
        !            33:        rm -f $T
        !            34: }
        !            35:
        !            36: run_rc_command "$1"

CVSweb <webmaster@jp.NetBSD.org>