dot.profile revision 1.1
11.1Smrg# $NetBSD: dot.profile,v 1.1 1998/06/06 05:29:50 mrg Exp $ 21.1Smrg# 31.1Smrg# Copyright (c) 1995 Jason R. Thorpe 41.1Smrg# Copyright (c) 1994 Christopher G. Demetriou 51.1Smrg# All rights reserved. 61.1Smrg# 71.1Smrg# Redistribution and use in source and binary forms, with or without 81.1Smrg# modification, are permitted provided that the following conditions 91.1Smrg# are met: 101.1Smrg# 1. Redistributions of source code must retain the above copyright 111.1Smrg# notice, this list of conditions and the following disclaimer. 121.1Smrg# 2. Redistributions in binary form must reproduce the above copyright 131.1Smrg# notice, this list of conditions and the following disclaimer in the 141.1Smrg# documentation and/or other materials provided with the distribution. 151.1Smrg# 3. All advertising materials mentioning features or use of this software 161.1Smrg# must display the following acknowledgement: 171.1Smrg# This product includes software developed by Christopher G. Demetriou. 181.1Smrg# 4. The name of the author may not be used to endorse or promote products 191.1Smrg# derived from this software without specific prior written permission 201.1Smrg# 211.1Smrg# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 221.1Smrg# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 231.1Smrg# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 241.1Smrg# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 251.1Smrg# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 261.1Smrg# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 271.1Smrg# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 281.1Smrg# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 291.1Smrg# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 301.1Smrg# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 311.1Smrg# 321.1Smrg 331.1SmrgPATH=/sbin:/bin:/usr/bin:/usr/sbin:/ 341.1Smrgexport PATH 351.1SmrgTERM=sun 361.1Smrgexport TERM 371.1SmrgHOME=/ 381.1Smrgexport HOME 391.1Smrg 401.1Smrgumask 022 411.1Smrg 421.1Smrgif [ "X${DONEPROFILE}" = "X" ]; then 431.1Smrg DONEPROFILE=YES 441.1Smrg 451.1Smrg # set up some sane defaults 461.1Smrg echo 'erase ^H, werase ^W, kill ^U, intr ^C, status ^T' 471.1Smrg stty newcrt werase ^W intr ^C kill ^U erase ^H status ^T 9600 481.1Smrg 491.1Smrg # run update, so that installed software is written as it goes. 501.1Smrg update 511.1Smrg 521.1Smrg # get the terminal type 531.1Smrg _forceloop="" 541.1Smrg while [ "X${_forceloop}" = X"" ]; do 551.1Smrg eval `tset -s -m ":?$TERM"` 561.1Smrg if [ "X${TERM}" != X"unknown" ]; then 571.1Smrg _forceloop="done" 581.1Smrg fi 591.1Smrg done 601.1Smrg 611.1Smrg # Installing or upgrading? 621.1Smrg _forceloop="" 631.1Smrg while [ "X${_forceloop}" = X"" ]; do 641.1Smrg echo -n '(I)nstall, (S)hell or (H)alt ? ' 651.1Smrg read _forceloop 661.1Smrg case "$_forceloop" in 671.1Smrg i*|I*) 681.1Smrg /sysinst 691.1Smrg ;; 701.1Smrg 711.1Smrg s*|S*) 721.1Smrg /bin/sh 731.1Smrg ;; 741.1Smrg 751.1Smrg h*|H*) 761.1Smrg /sbin/halt 771.1Smrg ;; 781.1Smrg 791.1Smrg *) 801.1Smrg _forceloop="" 811.1Smrg ;; 821.1Smrg esac 831.1Smrg done 841.1Smrgfi 85