#
# Network Installation Kit
#
# wrapper.client: wrapper script for clients
#
# Tom Coppeto
# MIT Network Group
# 17 September 1994
#
# Last Modified 20 January 1996 by jyp
#
#!/bin/csh -f

set pltfrm = `/usr/bin/uname`

if ($pltfrm == "SunOS") then
	set info = "mini-install: last updated 6/1/94 by tom "
	set path = (/bin /usr/bin /usr/ucb)
else
	set info = "irix-52 mini-install: last updated 6/29/94 by tom "
	set path = (/bin /usr/bin /usr/ucb /usr/bsd)
endif

if(`whoami` != root) then
	echo "You must be root to run this installation package."
	exit 1
endif

/bin/rm -rf /usr/tmp/mit-install
mkdir /usr/tmp/mit-install
cd /usr/tmp/mit-install

echo $info
echo "retrieving rest of installation from net-dist.mit.edu..."

if ($pltfrm == "SunOS") then
	ftp -n 18.72.0.3 << EOF
	user anonymous suninstaller
	cd installkits/sunos-4.1x
	bin
	get dist.tar.Z
	quit
	EOF
else
	ftp -n 18.72.0.3 << EOF
	user anonymous suninstaller
	cd installkits/irix-52/beta
	bin
	get dist.tar.Z
	get sgiload-temp.tar.Z
	quit
	EOF
endif


if (! -f dist.tar.Z) then
	echo "unable to ftp installation package. Try again later or seek help."	
	exit 1
endif

# check sum

zcat dist.tar.Z | tar xf -
rm -f dist.tar.Z


# When using SGI get these libraries 

if ($pltfrm == "IRIX") then
	if(! -f /usr/lib/libsocket.so) then
        	cp -p net/libsocket.so /usr/lib
	endif
	if(! -f /usr/lib/libnsl.so) then
        	cp -p net/libnsl.so /usr/lib
	endif
endif

./toplevels/main.client


