dot.profile revision 1.1
11.1Sleo# $NetBSD: dot.profile,v 1.1 2002/04/12 21:11:47 leo Exp $ 21.1Sleo# 31.1Sleo# Copyright (c) 1995 Jason R. Thorpe 41.1Sleo# Copyright (c) 1994 Christopher G. Demetriou 51.1Sleo# All rights reserved. 61.1Sleo# 71.1Sleo# Redistribution and use in source and binary forms, with or without 81.1Sleo# modification, are permitted provided that the following conditions 91.1Sleo# are met: 101.1Sleo# 1. Redistributions of source code must retain the above copyright 111.1Sleo# notice, this list of conditions and the following disclaimer. 121.1Sleo# 2. Redistributions in binary form must reproduce the above copyright 131.1Sleo# notice, this list of conditions and the following disclaimer in the 141.1Sleo# documentation and/or other materials provided with the distribution. 151.1Sleo# 3. All advertising materials mentioning features or use of this software 161.1Sleo# must display the following acknowledgement: 171.1Sleo# This product includes software developed for the 181.1Sleo# NetBSD Project. See http://www.netbsd.org/ for 191.1Sleo# information about NetBSD. 201.1Sleo# 4. The name of the author may not be used to endorse or promote products 211.1Sleo# derived from this software without specific prior written permission. 221.1Sleo# 231.1Sleo# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 241.1Sleo# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 251.1Sleo# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 261.1Sleo# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 271.1Sleo# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 281.1Sleo# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 291.1Sleo# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 301.1Sleo# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 311.1Sleo# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 321.1Sleo# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 331.1Sleo# 341.1Sleo# <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>> 351.1Sleo 361.1SleoPATH=/sbin:/bin:/usr/bin:/usr/sbin:/ 371.1Sleoexport PATH 381.1SleoTERM=vt220 391.1Sleoexport TERM 401.1SleoHOME=/ 411.1Sleoexport HOME 421.1SleoOBLOCKSIZE=1k 431.1Sleoexport BLOCKSIZE 441.1SleoEDITOR=ed 451.1Sleoexport EDITOR 461.1Sleo 471.1Sleoumask 022 481.1Sleo 491.1Sleomakerootwritable() { 501.1Sleo if [ ! -e /tmp/.root_writable ]; then 511.1Sleo if [ ! -e /kern/msgbuf ]; then 521.1Sleo mount -t kernfs /kern /kern 531.1Sleo fi 541.1Sleo mount -t ffs -u /kern/rootdev / 551.1Sleo cp /dev/null /tmp/.root_writable 561.1Sleo fi 571.1Sleo} 581.1Sleo 591.1Sleoif [ "X${DONEPROFILE}" = "X" ]; then 601.1Sleo DONEPROFILE=YES 611.1Sleo export DONEPROFILE 621.1Sleo 631.1Sleo # set up some sane defaults 641.1Sleo echo 'erase ^H, werase ^W, kill ^U, intr ^C' 651.1Sleo stty newcrt werase ^W intr ^C kill ^U erase ^H 9600 661.1Sleo 671.1Sleo # mount root read write 681.1Sleo makerootwritable 691.1Sleo 701.1Sleo # If supported: Select a keyboard map 711.1Sleo /usr/sbin/loadkmap > /dev/null 2>&1 721.1Sleo if [ $? -eq 0 ]; then 731.1Sleo _maps=`ls /usr/share/keymaps/atari | sed 's/\.map//g'` 741.1Sleo fi 751.1Sleo while [ ! -z "$_maps" ]; do 761.1Sleo echo "The available keyboard maps are:" 771.1Sleo _num=0 781.1Sleo for i in $_maps; do 791.1Sleo echo " $_num $i" 801.1Sleo _num=`expr $_num + 1` 811.1Sleo done 821.1Sleo echo 831.1Sleo echo -n "Select the number of the map you want to activate: " 841.1Sleo read _ans 851.1Sleo 861.1Sleo # Delete all non-nummeric characters from the users answer 871.1Sleo if [ ! -z "$_ans" ]; then 881.1Sleo _ans=`echo $_ans | sed 's/[^0-9]//g` 891.1Sleo fi 901.1Sleo 911.1Sleo # Check if the answer is valid (in range). Note that an answer 921.1Sleo # < 0 cannot happen because the sed(1) above also removes the 931.1Sleo # sign. 941.1Sleo if [ -z "$_ans" -o "$_ans" -ge $_num ]; then 951.1Sleo echo "You entered an invalid response, please try again." 961.1Sleo continue 971.1Sleo fi 981.1Sleo 991.1Sleo # Got a valid answer, activate the map... 1001.1Sleo set -- $_maps 1011.1Sleo shift $_ans 1021.1Sleo /usr/sbin/loadkmap -f /usr/share/keymaps/atari/$1.map 1031.1Sleo break 1041.1Sleo done 1051.1Sleo 1061.1Sleo if [ -x /sysinst ]; then 1071.1Sleo sysinst 1081.1Sleo else 1091.1Sleo if [ -x /upgrade ]; then 1101.1Sleo # 1111.1Sleo # Original installation script. 1121.1Sleo # Installing or upgrading? 1131.1Sleo _forceloop="" 1141.1Sleo while [ "X${_forceloop}" = X"" ]; do 1151.1Sleo echo -n '(I)nstall or (U)pgrade? ' 1161.1Sleo read _forceloop 1171.1Sleo case "$_forceloop" in 1181.1Sleo i*|I*) 1191.1Sleo /install 1201.1Sleo ;; 1211.1Sleo 1221.1Sleo u*|U*) 1231.1Sleo /upgrade 1241.1Sleo ;; 1251.1Sleo 1261.1Sleo *) 1271.1Sleo _forceloop="" 1281.1Sleo ;; 1291.1Sleo esac 1301.1Sleo done 1311.1Sleo else 1321.1Sleo # 1331.1Sleo # Stripped down preparation version 1341.1Sleo /install 1351.1Sleo fi 1361.1Sleo fi 1371.1Sleofi 138