diff options
author | peter <peter@FreeBSD.org> | 1999-08-06 06:16:06 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-08-06 06:16:06 +0000 |
commit | 753bd4730c6b2aa5e6f0b777d13e5f07823ebcbc (patch) | |
tree | 62ecba0a6b67a3e108b3338b58b042d365694c22 | |
parent | 9f770d77c9224ba54efc6a701de94bb5efbd0023 (diff) | |
download | FreeBSD-src-753bd4730c6b2aa5e6f0b777d13e5f07823ebcbc.zip FreeBSD-src-753bd4730c6b2aa5e6f0b777d13e5f07823ebcbc.tar.gz |
Don't use /tmp/_motd in the aftermath of the chflags(2) revelations.
Obtained from: OpenBSD (millert etc/rc rev 1.102 and hugh)
-rw-r--r-- | etc/rc | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -1,5 +1,5 @@ #!/bin/sh -# $Id: rc,v 1.189 1999/06/21 15:59:42 sheldonh Exp $ +# $Id: rc,v 1.190 1999/08/02 05:42:44 imp Exp $ # From: @(#)rc 5.27 (Berkeley) 6/5/91 # System startup script run by init on autoboot @@ -400,13 +400,16 @@ if [ "X${local_startup}" != X"NO" ]; then fi if [ "X${update_motd}" != X"NO" ]; then - T=/tmp/_motd - rm -rf $T - uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > $T - awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> $T - cp $T /etc/motd - chmod 644 /etc/motd - rm -rf $T + T=`mktemp /tmp/_motd.XXXXXX` + if [ $? -ne 0 ]; then + uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > $T + awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> $T + cmp -s $T /etc/motd || { + cp $T /etc/motd + chmod 644 /etc/motd + } + rm -f $T + fi fi # Run rc.devfs if present to customify devfs |