version 1.130, 2000/02/28 17:28:35 |
version 1.131, 2000/03/05 16:55:22 |
|
|
# Output and error are redirected to console by init, |
# Output and error are redirected to console by init, |
# and the console is the controlling terminal. |
# and the console is the controlling terminal. |
|
|
|
# Subroutines (have to come first). |
|
|
|
# Strip comments (and leading/trailing whitespace if IFS is set) |
|
# from a file and spew to stdout |
|
stripcom() { |
|
local _file="$1" |
|
local _line |
|
|
|
{ |
|
while read _line ; do |
|
_line=${_line%%#*} # strip comments |
|
test -z "$_line" && continue |
|
echo $_line |
|
done |
|
} < $_file |
|
} |
|
|
|
# End subroutines |
|
|
stty status '^T' |
stty status '^T' |
|
|
# Set shell to ignore SIGINT (2), but not children; |
# Set shell to ignore SIGINT (2), but not children; |
|
|
if [ -f /etc/sysctl.conf ]; then |
if [ -f /etc/sysctl.conf ]; then |
( |
( |
# delete comments and blank lines |
# delete comments and blank lines |
# we use ed here because /usr may not be mounted yet. |
set -- `stripcom /etc/sysctl.conf` |
set -- ` |
|
ed -s /etc/sysctl.conf <<EOF |
|
1,\\\$s/#.*$// |
|
g/^..*/p |
|
Q |
|
EOF |
|
` |
|
while [ $# -ge 1 ] ; do |
while [ $# -ge 1 ] ; do |
sysctl -w $1 |
sysctl -w $1 |
shift |
shift |
|
|
if [ -f /etc/ifaliases ]; then |
if [ -f /etc/ifaliases ]; then |
( |
( |
# delete comments and blank lines |
# delete comments and blank lines |
set -- `sed -e 's/#.*$//' -e '/^$/d' /etc/ifaliases` |
set -- `stripcom /etc/ifaliases` |
while [ $# -ge 3 ] ; do |
while [ $# -ge 3 ] ; do |
ifconfig $1 inet alias $2 netmask $3 |
ifconfig $1 inet alias $2 netmask $3 |
route -n add -host $2 localhost |
route -n add -host $2 localhost |
|
|
if [ ! -f /etc/motd ]; then |
if [ ! -f /etc/motd ]; then |
install -c -o root -g wheel -m 664 /dev/null /etc/motd |
install -c -o root -g wheel -m 664 /dev/null /etc/motd |
fi |
fi |
T=`mktemp /tmp/_motd.XXXXXXXXXX` |
T=`mktemp /tmp/_motd.XXXXXXXXXX` |
if [ $? -eq 0 ]; then |
if [ $? -eq 0 ]; then |
sysctl -n kern.version | sed 1q > $T |
sysctl -n kern.version | sed 1q > $T |
echo "" >> $T |
echo "" >> $T |