#!/bin/csh -f
# Last Modified 12 November 1995

set pltfrm = `/usr/bin/uname`

source install.conf

if($interactive == true) then
	vclear
	vecho "DE-INSTALL"
	vecho ""
	vecho "                        Network Utilities"
	vecho $bar
	vecho ""
	vecho ""
	vecho "Removing:"
	vecho "                /bin/athena/hesinfo"
	vecho "                /bin/athena/hostinfo"
	vecho "                /etc/named*"
	vecho "                /etc/resolv.conf"
	vecho "                /etc/athena/gettime"
	vecho "                /etc/athena/snmpd"
	vecho "                /etc/athena/snmpd.conf"
	vecho "                /usr/lib/libc.so.1.7.3"
	if ($pltfrm == "IRIX") then
	        vecho "                /etc/athena/timed"
 		vecho "                /etc/athena/timedc"
	endif
	vecho "Renamed files:"
	vecho "                /usr/etc/in.named -> /usr/etc/in.named.sun"
	vecho "Disk consumed:"
	vecho "                /               ?Kb"
	vecho "                /usr          540Kb"
	vecho ""
	df / /usr
	vecho ""
	get_response "continue? (yes/no) " "yes" "no"
	if($status == 2) exit 0
endif

vlog "**  running deinstall.net:"

#
# named
#

vecho "     removing named..."
vlog "net: removing named and named configs"
if ($pltfrm == "SunOS") then
	rm -f /etc/named
endif
rm -f /etc/named.boot
rm -f /etc/named.root
rm -f /etc/named.mit
rm -f /etc/resolv.conf

if ($pltfrm == "SunOS") then
	if (-f /usr/etc/in.named.sun) then
		vlog "net: renamed /usr/etc/in.named"
		rm -f /usr/etc/in.named
		mv /usr/etc/in.named.sun /usr/etc/in.named
	endif
endif

rm -f /bin/athena/hostinfo
rm -f /bin/athena/hesinfo

if ($pltfrm == "SunOS") then
	vecho "     removing time..."
	vlog "net: removing timed and friends"
	rm -f /etc/athena/gettime
	config.rc TIMED false
	config.rc TIMECLIENT false
	vecho "     removing snmpd..."
	vlog "net: removing snmpd & snmpd.conf"
	rm -f /etc/snmpd
	rm -f /etc/snmpd.conf
	config.rc SNMP false
	if( -f /usr/lib/libc.so.1.7.3) then
		vecho "     removing shared library..."
		vlog "net: removing shared lib"
		rm -f /usr/lib/libc.so.1.7.3
		/usr/etc/ldconfig
	endif
endif	

version delete DNS
version delete SNMP
version delete TimeClient

vlog "net: updated version"
vlog "**  done."

vecho "done."

if($interactive == true) then
	vecho ""
	vecho "These changes will take effect after the next reboot."
	get_response "Press <return> to continue..." "<return>"
endif

if($sing == true) then
 	$sounds/kill_song
	$play $sounds/why_am_i_here.au
endif
exit 0



