Home | History | Annotate | Line # | Download | only in miniroot
dot.profile revision 1.1.2.2
      1  1.1.2.2      is #	$NetBSD: dot.profile,v 1.1.2.2 1997/11/21 21:46:14 is Exp $
      2      1.1      is #
      3      1.1      is # Copyright (c) 1995 Jason R. Thorpe
      4      1.1      is # Copyright (c) 1994 Christopher G. Demetriou
      5      1.1      is # All rights reserved.
      6      1.1      is # 
      7      1.1      is # Redistribution and use in source and binary forms, with or without
      8      1.1      is # modification, are permitted provided that the following conditions
      9      1.1      is # are met:
     10      1.1      is # 1. Redistributions of source code must retain the above copyright
     11      1.1      is #    notice, this list of conditions and the following disclaimer.
     12      1.1      is # 2. Redistributions in binary form must reproduce the above copyright
     13      1.1      is #    notice, this list of conditions and the following disclaimer in the
     14      1.1      is #    documentation and/or other materials provided with the distribution.
     15      1.1      is # 3. All advertising materials mentioning features or use of this software
     16      1.1      is #    must display the following acknowledgement:
     17      1.1      is #	This product includes software developed by Christopher G. Demetriou.
     18      1.1      is # 4. The name of the author may not be used to endorse or promote products
     19      1.1      is #    derived from this software without specific prior written permission
     20      1.1      is #
     21      1.1      is # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22      1.1      is # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23      1.1      is # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24      1.1      is # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25      1.1      is # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26      1.1      is # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27      1.1      is # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28      1.1      is # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29      1.1      is # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30      1.1      is # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31      1.1      is #
     32      1.1      is 
     33      1.1      is PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
     34      1.1      is export PATH
     35      1.1      is TERM=vt220
     36      1.1      is export TERM
     37      1.1      is 
     38      1.1      is umask 022
     39      1.1      is 
     40      1.1      is if [ "X${DONEPROFILE}" = "X" ]; then
     41      1.1      is 	DONEPROFILE=YES
     42      1.1      is 
     43      1.1      is 	# set up some sane defaults
     44  1.1.2.1  mellon 	echo 'erase ^?, werase ^W, kill ^U, intr ^C'
     45  1.1.2.1  mellon 	stty newcrt werase ^W intr ^C kill ^U erase ^? 9600
     46      1.1      is 
     47      1.1      is 	# run update, so that installed software is written as it goes.
     48      1.1      is 	update
     49      1.1      is 
     50      1.1      is 	# Select a keyboard map
     51      1.1      is 	_maps=`ls /usr/share/keymaps/amiga | sed 's/\.map//g'`
     52      1.1      is 	while [ ! -z "$_maps" ]; do
     53      1.1      is 		echo "The available keyboard maps are:"
     54      1.1      is 		_num=0
     55      1.1      is 		for i in $_maps; do
     56      1.1      is 			echo "	$_num  $i"
     57      1.1      is 			_num=`expr $_num + 1`
     58      1.1      is 		done
     59      1.1      is 		echo
     60      1.1      is 		echo -n "Select the number of the map you want to activate: "
     61      1.1      is 		read _ans
     62      1.1      is 
     63      1.1      is 		# Delete all non-nummeric characters from the users answer
     64      1.1      is 		if [ ! -z "$_ans" ]; then
     65      1.1      is 			_ans=`echo $_ans | sed 's/[^0-9]//g`
     66      1.1      is 		fi
     67      1.1      is 
     68      1.1      is 		# Check if the answer is valid (in range). Note that an answer
     69      1.1      is 		# < 0 cannot happen because the sed(1) above also removes the
     70      1.1      is 		# sign.
     71      1.1      is 		if [ -z "$_ans" -o "$_ans" -ge $_num ]; then
     72      1.1      is 		    echo "You entered an invalid response, please try again."
     73      1.1      is 		    continue
     74      1.1      is 		fi
     75      1.1      is 
     76      1.1      is 		# Got a valid answer, activate the map...
     77      1.1      is 		set -- $_maps
     78      1.1      is 		shift $_ans
     79  1.1.2.2      is 		export __keymap__=/usr/share/keymaps/amiga/$1.map
     80  1.1.2.2      is 		/usr/sbin/loadkmap ${__keymap__}
     81      1.1      is 		break
     82      1.1      is 	done
     83      1.1      is 
     84      1.1      is 	# Installing or upgrading?
     85      1.1      is 	_forceloop=""
     86      1.1      is 	while [ "X${_forceloop}" = X"" ]; do
     87      1.1      is 		echo -n '(I)nstall or (U)pgrade? '
     88      1.1      is 		read _forceloop
     89      1.1      is 		case "$_forceloop" in
     90      1.1      is 			i*|I*)
     91      1.1      is 				/install
     92      1.1      is 				;;
     93      1.1      is 
     94      1.1      is 			u*|U*)
     95      1.1      is 				/upgrade
     96      1.1      is 				;;
     97      1.1      is 
     98      1.1      is 			*)
     99      1.1      is 				_forceloop=""
    100      1.1      is 				;;
    101      1.1      is 		esac
    102      1.1      is 	done
    103      1.1      is fi
    104