11.4Ssalo# $NetBSD: dot.profile,v 1.4 2003/07/26 17:07:42 salo Exp $
21.1Smatt#
31.1Smatt# Copyright (c) 1995 Jason R. Thorpe
41.1Smatt# Copyright (c) 1994 Christopher G. Demetriou
51.1Smatt# All rights reserved.
61.1Smatt# 
71.1Smatt# Redistribution and use in source and binary forms, with or without
81.1Smatt# modification, are permitted provided that the following conditions
91.1Smatt# are met:
101.1Smatt# 1. Redistributions of source code must retain the above copyright
111.1Smatt#    notice, this list of conditions and the following disclaimer.
121.1Smatt# 2. Redistributions in binary form must reproduce the above copyright
131.1Smatt#    notice, this list of conditions and the following disclaimer in the
141.1Smatt#    documentation and/or other materials provided with the distribution.
151.1Smatt# 3. All advertising materials mentioning features or use of this software
161.1Smatt#    must display the following acknowledgement:
171.3Scgd#          This product includes software developed for the
181.4Ssalo#          NetBSD Project.  See http://www.NetBSD.org/ for
191.3Scgd#          information about NetBSD.
201.1Smatt# 4. The name of the author may not be used to endorse or promote products
211.3Scgd#    derived from this software without specific prior written permission.
221.3Scgd# 
231.1Smatt# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
241.1Smatt# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
251.1Smatt# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
261.1Smatt# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
271.1Smatt# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
281.1Smatt# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
291.1Smatt# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
301.1Smatt# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
311.1Smatt# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
321.1Smatt# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
331.3Scgd# 
341.3Scgd# <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
351.1Smatt
361.1SmattPATH=/sbin:/bin:/usr/bin:/usr/sbin:/
371.1Smattexport PATH
381.1SmattTERM=sun
391.1Smattexport TERM
401.1SmattHOME=/
411.1Smattexport HOME
421.1Smatt
431.1Smattumask 022
441.1Smatt
451.1Smattif [ "X${DONEPROFILE}" = "X" ]; then
461.1Smatt	DONEPROFILE=YES
471.1Smatt	export DONEPROFILE
481.1Smatt
491.1Smatt	# set up some sane defaults
501.1Smatt	echo 'erase ^H, werase ^W, kill ^U, intr ^C'
511.1Smatt	stty newcrt werase ^W intr ^C kill ^U erase ^H 9600
521.1Smatt
531.1Smatt	# get the terminal type
541.1Smatt	_forceloop=""
551.1Smatt	while [ "X${_forceloop}" = X"" ]; do
561.1Smatt		eval `tset -s -m ":?$TERM"`
571.1Smatt		if [ "X${TERM}" != X"unknown" ]; then
581.1Smatt			_forceloop="done"
591.1Smatt		fi
601.1Smatt	done
611.1Smatt
621.1Smatt	# Installing or upgrading?
631.1Smatt	_forceloop=""
641.1Smatt	while [ "X${_forceloop}" = X"" ]; do
651.1Smatt		echo -n '(I)nstall or (U)pgrade? '
661.1Smatt		read _forceloop
671.1Smatt		case "$_forceloop" in
681.1Smatt			i*|I*)
691.1Smatt				/install
701.1Smatt				;;
711.1Smatt
721.1Smatt			u*|U*)
731.1Smatt				/upgrade
741.1Smatt				;;
751.1Smatt
761.1Smatt			*)
771.1Smatt				_forceloop=""
781.1Smatt				;;
791.1Smatt		esac
801.1Smatt	done
811.1Smattfi
82