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

1.1       lukem       1: #!/bin/sh
                      2: #
1.6     ! nisimura    3: # $NetBSD: motd,v 1.5 2000/09/19 13:04:38 lukem Exp $
1.1       lukem       4: #
                      5:
                      6: # PROVIDE: motd
1.3       lukem       7: # REQUIRE: mountcritremote
1.1       lukem       8:
                      9: . /etc/rc.subr
                     10:
                     11: name="motd"
1.5       lukem      12: rcvar="update_motd"
1.1       lukem      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
1.6     ! nisimura   27:        sysctl -n kern.version | while read i; do echo $i; break; done > $T
1.4       chuck      28:        sed '1{/^NetBSD.*/{d;};};' < /etc/motd >> $T
1.1       lukem      29:        cmp -s $T /etc/motd || cp $T /etc/motd
                     30:        rm -f $T
                     31: }
                     32:
1.2       lukem      33: load_rc_config $name
1.1       lukem      34: run_rc_command "$1"

CVSweb <webmaster@jp.NetBSD.org>