motd revision 78344
178344Sobrien#!/bin/sh 278344Sobrien# 378344Sobrien# $NetBSD: motd,v 1.5 2000/09/19 13:04:38 lukem Exp $ 478344Sobrien# 578344Sobrien 678344Sobrien# PROVIDE: motd 778344Sobrien# REQUIRE: mountcritremote 878344Sobrien 978344Sobrien. /etc/rc.subr 1078344Sobrien 1178344Sobrienname="motd" 1278344Sobrienrcvar="update_motd" 1378344Sobrienstart_cmd="motd_start" 1478344Sobrienstop_cmd=":" 1578344Sobrien 1678344Sobrienmotd_start() 1778344Sobrien{ 1878344Sobrien # Update kernel info in /etc/motd 1978344Sobrien # Must be done *before* interactive logins are possible 2078344Sobrien # to prevent possible race conditions. 2178344Sobrien # 2278344Sobrien echo "Updating motd." 2378344Sobrien if [ ! -f /etc/motd ]; then 2478344Sobrien install -c -o root -g wheel -m 664 /dev/null /etc/motd 2578344Sobrien fi 2678344Sobrien T=/etc/_motd 2778344Sobrien sysctl -n kern.version | while read i; do echo $i; break; done > $T 2878344Sobrien sed '1{/^NetBSD.*/{d;};};' < /etc/motd >> $T 2978344Sobrien cmp -s $T /etc/motd || cp $T /etc/motd 3078344Sobrien rm -f $T 3178344Sobrien} 3278344Sobrien 3378344Sobrienload_rc_config $name 3478344Sobrienrun_rc_command "$1" 35