dot.commonutils revision 1.1
11.1Schopps#
21.1Schopps# Copyright (c) 1994 Christopher G. Demetriou
31.1Schopps# All rights reserved.
41.1Schopps# 
51.1Schopps# Redistribution and use in source and binary forms, with or without
61.1Schopps# modification, are permitted provided that the following conditions
71.1Schopps# are met:
81.1Schopps# 1. Redistributions of source code must retain the above copyright
91.1Schopps#    notice, this list of conditions and the following disclaimer.
101.1Schopps# 2. Redistributions in binary form must reproduce the above copyright
111.1Schopps#    notice, this list of conditions and the following disclaimer in the
121.1Schopps#    documentation and/or other materials provided with the distribution.
131.1Schopps# 3. All advertising materials mentioning features or use of this software
141.1Schopps#    must display the following acknowledgement:
151.1Schopps#	This product includes software developed by Christopher G. Demetriou.
161.1Schopps# 4. The name of the author may not be used to endorse or promote products
171.1Schopps#    derived from this software without specific prior written permission
181.1Schopps#
191.1Schopps# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
201.1Schopps# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
211.1Schopps# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
221.1Schopps# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
231.1Schopps# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
241.1Schopps# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
251.1Schopps# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
261.1Schopps# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
271.1Schopps# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
281.1Schopps# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
291.1Schopps$
301.1Schopps$	$Id: dot.commonutils,v 1.1 1994/10/06 20:25:50 chopps Exp $
311.1Schopps
321.1Schopps# Installation utilites (functions), to get NetBSD installed on
331.1Schopps# the hard disk.  These are meant to be invoked from the shell prompt,
341.1Schopps# by people installing NetBSD.
351.1Schopps
361.1SchoppsSet_tmp_dir()
371.1Schopps{
381.1Schopps	def_tmp_dir=`pwd`
391.1Schopps	if [ "$def_tmp_dir" = "/" -o "$def_tmp_dir" = "/mnt" ]; then
401.1Schopps		def_tmp_dir=/mnt/usr/distrib
411.1Schopps	fi
421.1Schopps
431.1Schopps	echo -n	"What directory should be used to find and/or store "
441.1Schopps	echo	"installtion"
451.1Schopps	echo -n	"files? [$def_tmp_dir] "
461.1Schopps	read tmp_dir
471.1Schopps	if [ "$tmp_dir" = "" ]; then
481.1Schopps		tmp_dir=$def_tmp_dir
491.1Schopps	fi
501.1Schopps	if [ ! -d "$tmp_dir" ]; then
511.1Schopps		/bin/rm -rf $tmp_dir
521.1Schopps		mkdir -p $tmp_dir
531.1Schopps	fi
541.1Schopps}
551.1Schopps
561.1SchoppsTmp_dir()
571.1Schopps{
581.1Schopps	if [ "$tmp_dir" = "" ]; then
591.1Schopps		Set_tmp_dir
601.1Schopps	fi
611.1Schopps	cd $tmp_dir
621.1Schopps}
631.1Schopps
641.1SchoppsLoad_fd()
651.1Schopps{
661.1Schopps	Tmp_dir
671.1Schopps	which=
681.1Schopps	while [ "$which" != "a" -a "$which" != "b" ]; do
691.1Schopps		echo -n	"Read from which floppy drive ('a' or 'b')? [a] "
701.1Schopps		read which
711.1Schopps		if [ "X$which" = "X" ]; then
721.1Schopps			which=a
731.1Schopps		fi
741.1Schopps	done
751.1Schopps	while echo -n "Insert floppy (hit ^C to terminate, enter to load): "
761.1Schopps	do
771.1Schopps		mount -t msdos /dev/fd0$which /mnt2
781.1Schopps		cp -rp /mnt2/* .
791.1Schopps		umount /mnt2
801.1Schopps	done
811.1Schopps}
821.1Schopps
831.1SchoppsLoad_tape()
841.1Schopps{
851.1Schopps	Tmp_dir
861.1Schopps	echo -n	"Which tape drive will you be using? [rst0] "
871.1Schopps	read which
881.1Schopps	if [ "X$which" = "X" ]; then
891.1Schopps		which=rst0
901.1Schopps	fi
911.1Schopps	echo -n "Insert the tape into the tape drive and hit return to "
921.1Schopps	echo -n "continue..."
931.1Schopps	read foo
941.1Schopps	echo	"Extracting files from the tape..."
951.1Schopps	tar xvfp /dev/$which
961.1Schopps	echo	"Done."
971.1Schopps}
981.1Schopps
991.1SchoppsExtract()
1001.1Schopps{
1011.1Schopps	Tmp_dir
1021.1Schopps	echo -n "Would you like to list the files as they're extracted? [n] "
1031.1Schopps	read verbose
1041.1Schopps	case $verbose in
1051.1Schopps	y*|Y*)
1061.1Schopps		tarverbose=v
1071.1Schopps		;;
1081.1Schopps	*)
1091.1Schopps		tarverbose=
1101.1Schopps		;;
1111.1Schopps	esac
1121.1Schopps	cat "$1".??? | gunzip | (cd / ; tar xfp$tarverbose -)
1131.1Schopps}
114