dot.profile revision 1.2
11.2Stsutsui#	$NetBSD: dot.profile,v 1.2 2000/01/21 12:32:55 tsutsui Exp $
21.1Stsutsui#
31.1Stsutsui# Copyright (c) 1995 Jason R. Thorpe
41.1Stsutsui# Copyright (c) 1994 Christopher G. Demetriou
51.1Stsutsui# All rights reserved.
61.1Stsutsui# 
71.1Stsutsui# Redistribution and use in source and binary forms, with or without
81.1Stsutsui# modification, are permitted provided that the following conditions
91.1Stsutsui# are met:
101.1Stsutsui# 1. Redistributions of source code must retain the above copyright
111.1Stsutsui#    notice, this list of conditions and the following disclaimer.
121.1Stsutsui# 2. Redistributions in binary form must reproduce the above copyright
131.1Stsutsui#    notice, this list of conditions and the following disclaimer in the
141.1Stsutsui#    documentation and/or other materials provided with the distribution.
151.1Stsutsui# 3. All advertising materials mentioning features or use of this software
161.1Stsutsui#    must display the following acknowledgement:
171.1Stsutsui#	This product includes software developed by Christopher G. Demetriou.
181.1Stsutsui# 4. The name of the author may not be used to endorse or promote products
191.1Stsutsui#    derived from this software without specific prior written permission
201.1Stsutsui#
211.1Stsutsui# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
221.1Stsutsui# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
231.1Stsutsui# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
241.1Stsutsui# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
251.1Stsutsui# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
261.1Stsutsui# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
271.1Stsutsui# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
281.1Stsutsui# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
291.1Stsutsui# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
301.1Stsutsui# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
311.1Stsutsui#
321.1Stsutsui
331.1StsutsuiPATH=/sbin:/bin:/usr/bin:/usr/sbin:/
341.1Stsutsuiexport PATH
351.1StsutsuiTERM=vt100
361.1Stsutsuiexport TERM
371.1StsutsuiHOME=/
381.1Stsutsuiexport HOME
391.1Stsutsui
401.1Stsutsuiumask 022
411.1Stsutsui
421.1Stsutsuiif [ "X${DONEPROFILE}" = "X" ]; then
431.1Stsutsui	DONEPROFILE=YES
441.1Stsutsui
451.1Stsutsui	# set up some sane defaults
461.1Stsutsui	echo 'erase ^H, werase ^W, kill ^U, intr ^C, status ^T'
471.1Stsutsui	stty newcrt werase ^W intr ^C kill ^U erase ^H status ^T 9600
481.1Stsutsui
491.1Stsutsui	# mount root read-write
501.2Stsutsui	mount -u /dev/md0a /
511.1Stsutsui
521.1Stsutsui	# mount a /tmp on mfs, to avoid filling the md
531.1Stsutsui	mount -t mfs swap /tmp
541.1Stsutsui
551.1Stsutsui	# mount the kern_fs so that we can examine the dmesg state
561.1Stsutsui	mount -t kernfs kern /kern
571.1Stsutsui
581.1Stsutsui	# get the terminal type
591.1Stsutsui	_forceloop=""
601.1Stsutsui	while [ "X${_forceloop}" = X"" ]; do
611.1Stsutsui		eval `tset -s -m ":?$TERM"`
621.1Stsutsui		if [ "X${TERM}" != X"unknown" ]; then
631.1Stsutsui			_forceloop="done"
641.1Stsutsui		fi
651.1Stsutsui	done
661.1Stsutsui
671.1Stsutsui	# Installing or upgrading?
681.1Stsutsui	_forceloop=""
691.1Stsutsui	while [ "X${_forceloop}" = X"" ]; do
701.1Stsutsui		echo -n '(I)nstall, (S)hell or (H)alt ? '
711.1Stsutsui		read _forceloop
721.1Stsutsui		case "$_forceloop" in
731.1Stsutsui			i*|I*)
741.1Stsutsui				/sysinst
751.1Stsutsui				;;
761.1Stsutsui
771.1Stsutsui			s*|S*)
781.1Stsutsui				/bin/sh
791.1Stsutsui				;;
801.1Stsutsui
811.1Stsutsui			h*|H*)
821.1Stsutsui				/sbin/halt
831.1Stsutsui				;;
841.1Stsutsui
851.1Stsutsui			*)
861.1Stsutsui				_forceloop=""
871.1Stsutsui				;;
881.1Stsutsui		esac
891.1Stsutsui	done
901.1Stsutsuifi
91