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