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