#!/bin/sh

# Run this script to install survey and pcmcia-info
# in the directory location of your choice.
# Install creates an UnInstall script to remove itself. if needed
# Copyright (C) 1999 Everett W. Holland, Jr. <everett@roanoke.infi.net>

if [ -w /etc/passwd ]   # Check for root user
then
 echo Install in which directory?
 
 echo "1.   /usr/local/bin  (Used by everyone)"
 echo "2.   /usr/bin        (Used by everyone)"
 echo "3.   /usr/sbin       (Used by Admin.)"
 echo "4.   /sbin           (Used by Admin.)"
 echo "5.   Install somewhere else..."
 echo "6.   Abort installation."
 echo
 read number
 case $number in
	1)
		install -m555 survey pcmcia-info  /usr/local/bin
		echo "cd /usr/local/bin" >UnInstall
		echo "rm survey pcmcia-info" >>UnInstall ;;
	2)
		install -m555 survey pcmcia-info  /usr/bin
		echo "cd /usr/bin" >UnInstall
		echo "rm survey pcmcia-info" >>UnInstall ;;
	3)
		install -m555 survey pcmcia-info  /usr/sbin
		echo "cd /usr/sbin" >UnInstall
		echo "rm survey pcmcia-info" >>UnInstall ;;
	4)
		install -m555 survey pcmcia-info  /sbin
		echo "cd /sbin" >UnInstall
		echo "rm survey pcmcia-info" >>UnInstall ;;
	5)
		echo Install in which directory?
		read insdir
		install -m 555 survey pcmcia-info $insdir
		echo "cd $insdir" >UnInstall
		echo "rm survey pcmcia-info" >>UnInstall ;;
	*)
		exit;;
 esac
chmod +x UnInstall 2>/dev/null
else
 echo Must be root to install, aborting...
fi

# Install program for SURVEY - Dump all system info
# This file is part of survey - a program to Dump all system file info
# Copyright (C) 1994-99 Everett W. Holland, Jr.
#         <everett@roanoke.infi.net>
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of the GNU General Public License as 
#    published by the Free Software Foundation; either version 2 of the
#    License, or (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
