diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-05-11 18:44:35 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-05-11 18:44:35 +0000 |
commit | cfe0831504bd6f24b6ad214b0683e6443d87e6ce (patch) | |
tree | 818dbf45908f829c357c0264b7e2bc4af6c6b7ca /distrib | |
parent | 05acc09f9fc46ffc1a699f5d4b51adcc16323b7a (diff) |
Ask user for term type, allowing anything in the stub termcap file.
Diffstat (limited to 'distrib')
-rw-r--r-- | distrib/alpha/ramdisk/dot.profile | 72 |
1 files changed, 57 insertions, 15 deletions
diff --git a/distrib/alpha/ramdisk/dot.profile b/distrib/alpha/ramdisk/dot.profile index df4d865a444..607d4761b97 100644 --- a/distrib/alpha/ramdisk/dot.profile +++ b/distrib/alpha/ramdisk/dot.profile @@ -1,5 +1,5 @@ # -# $OpenBSD: dot.profile,v 1.2 1997/05/08 06:13:42 millert Exp $ +# $OpenBSD: dot.profile,v 1.3 1997/05/11 18:44:34 millert Exp $ # # Copyright (c) 1994 Christopher G. Demetriou # All rights reserved. @@ -32,21 +32,63 @@ PATH=/sbin:/bin:/usr/bin:/usr/sbin:/ export PATH -TERM=vt200 -export TERM -# set up some sane defaults -echo 'erase ^?, werase ^H, kill ^U, intr ^C' -stty newcrt werase ^H intr ^C kill ^U erase ^? 9600 -echo '' +umask 022 -# mount / rw -mount /dev/rd0a / +# XXX +# the TERM/EDITOR stuff is really well enough parameterized to be moved +# into install.sub where it could use the routines there and be invoked +# from the various (semi) MI install and upgrade scripts -# pull in the function definitions that people will use from the shell prompt. -. /.commonutils -. /.instutils +# Terminals in termcap, default TERM. +# This assumes a *small* termcap file. +TERMS=`grep '^[A-z]' /usr/share/misc/termcap | sed -e 's/|[^|]*$//' -e 's/|/ /g'` +TERM=ansi-mini -# run the installation script. -umask 022 -install +if [ "X${DONEPROFILE}" = "X" ]; then + DONEPROFILE=YES + + # need a writable root + mount /dev/rd0a / + + isin() { + local _a + + _a=$1; shift + while [ $# != 0 ]; do + if [ "$_a" = "$1" ]; then return 0; fi + shift + done + return 1 + } + + + # set up some sane defaults + echo 'erase ^?, werase ^W, kill ^U, intr ^C' + stty newcrt werase ^W intr ^C kill ^U erase ^? 9600 + echo '' + + # get the terminal type + echo "Supported terminals are:" + echo $TERMS + _forceloop="" + while [ "X$_forceloop" = X"" ]; do + echo -n "TERM = ($TERM) " + read resp + if [ "X$resp" = "X" ]; then + break + fi + if isin $resp $TERMS ; then + break; + fi + echo "Type $resp unknown." + done + export TERM + + # pull in the functions that people will use from the shell prompt. + . /.commonutils + . /.instutils + + # run the installation script. + install +fi |