dot.profile revision 1.16
11.16Smartin# $NetBSD: dot.profile,v 1.16 2020/01/09 19:17:45 martin Exp $
21.1Spk#
31.1Spk# Copyright (c) 1995 Jason R. Thorpe
41.1Spk# Copyright (c) 1994 Christopher G. Demetriou
51.1Spk# All rights reserved.
61.1Spk# 
71.1Spk# Redistribution and use in source and binary forms, with or without
81.1Spk# modification, are permitted provided that the following conditions
91.1Spk# are met:
101.1Spk# 1. Redistributions of source code must retain the above copyright
111.1Spk#    notice, this list of conditions and the following disclaimer.
121.1Spk# 2. Redistributions in binary form must reproduce the above copyright
131.1Spk#    notice, this list of conditions and the following disclaimer in the
141.1Spk#    documentation and/or other materials provided with the distribution.
151.1Spk# 3. All advertising materials mentioning features or use of this software
161.1Spk#    must display the following acknowledgement:
171.6Scgd#          This product includes software developed for the
181.12Ssalo#          NetBSD Project.  See http://www.NetBSD.org/ for
191.6Scgd#          information about NetBSD.
201.1Spk# 4. The name of the author may not be used to endorse or promote products
211.6Scgd#    derived from this software without specific prior written permission.
221.6Scgd# 
231.1Spk# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
241.1Spk# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
251.1Spk# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
261.1Spk# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
271.1Spk# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
281.1Spk# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
291.1Spk# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
301.1Spk# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
311.1Spk# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
321.1Spk# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
331.6Scgd# 
341.6Scgd# <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
351.1Spk
361.1SpkPATH=/sbin:/bin:/usr/bin:/usr/sbin:/
371.1Spkexport PATH
381.14StsutsuiTERM=vt100
391.1Spkexport TERM
401.2SperryHOME=/
411.2Sperryexport HOME
421.1Spk
431.1Spkumask 022
441.1Spk
451.1Spkif [ "X${DONEPROFILE}" = "X" ]; then
461.1Spk	DONEPROFILE=YES
471.3Scgd	export DONEPROFILE
481.1Spk
491.1Spk	# set up some sane defaults
501.1Spk	echo 'erase ^H, werase ^W, kill ^U, intr ^C'
511.10Spk	stty newcrt werase ^W intr ^C kill ^U erase ^H
521.11Smartin
531.1Spk	# get the terminal type
541.1Spk	_forceloop=""
551.1Spk	while [ "X${_forceloop}" = X"" ]; do
561.1Spk		eval `tset -s -m ":?$TERM"`
571.1Spk		if [ "X${TERM}" != X"unknown" ]; then
581.1Spk			_forceloop="done"
591.1Spk		fi
601.1Spk	done
611.1Spk
621.1Spk	# Installing or upgrading?
631.1Spk	_forceloop=""
641.1Spk	while [ "X${_forceloop}" = X"" ]; do
651.7Spk		cat <<'EOF'
661.7Spk
671.9StvThis installer now uses the new `sysinst' installer tool by default.  To
681.9Stvuse the old install or upgrade shell scripts instead, enter the options
691.9Stv(OI) for Old Install or (OU) for Old Upgrade.
701.9Stv
711.9StvThe script-based installers may be removed in a future release.
721.7Spk
731.7SpkEOF
741.9Stv		echo -n '(I)nstall/Upgrade, (H)alt or (S)hell? '
751.1Spk		read _forceloop
761.1Spk		case "$_forceloop" in
771.9Stv			i*|I*|u*|U*)
781.9Stv				# setup a writable /tmp directory
791.13Spk				mount_mfs -s 1m swap /tmp || continue
801.16Smartin				/sysinst || stty sane
811.9Stv				;;
821.9Stv
831.9Stv			oi*|OI*)
841.1Spk				/install
851.1Spk				;;
861.1Spk
871.9Stv			ou*|OU*)
881.1Spk				/upgrade
891.7Spk				;;
901.7Spk
911.7Spk			h*|H*)
921.8Spk				#
931.8Spk				# XXX - if we're piggybacking a microroot, then
941.8Spk				# exit from this (chroot) environment: the
951.8Spk				# microroot's .profile will halt the machine.
961.8Spk				#
971.8Spk				if [ "$BOOTFS_DONEPROFILE" = YES ]; then
981.8Spk					exit
991.8Spk				else
1001.8Spk					/sbin/halt
1011.8Spk				fi
1021.7Spk				;;
1031.7Spk
1041.7Spk			s*|S*)
1051.7Spk				/bin/sh
1061.8Spk				continue
1071.1Spk				;;
1081.1Spk
1091.1Spk			*)
1101.1Spk				_forceloop=""
1111.1Spk				;;
1121.1Spk		esac
1131.1Spk	done
1141.1Spkfi
115