#!/bin/csh -f
#
# Network Installation Kit
#
# check.srvss: make a generic systems support server
#
# Tom Coppeto
# MIT Network Group
# 17 September 1994
#
# $Header: /afs/net.mit.edu/project/netconf/sun4/src/generic/RCS/check.srvss,v 1.1 94/09/18 11:50:34 tom Exp $
#

source $util/aliases

vclear
vecho ""
vecho ""
vecho "                      Check configuration (SS)"
vecho $bar
vecho ""
vecho ""
vecho "Possible modified files:"
vecho "                 /etc/inetd.conf             /etc/rc{.local}"
vecho "                 /etc/athena/update_server"
vecho ""
vecho "Renamed files:"
vecho "			/usr/lib/lpd                /usr/etc/keyserv"
vecho "			/usr/etc/rpc.statd          /usr/etc/rpc.lockd"
vecho ""
vecho ""
vecho ""
if ($interactive == true) then
	get_response "continue? (yes/no) " "yes" "no" 
	if($status == 2) exit -1
endif

log "**  running ss server check:"

if(! -d /usr/local/bin) mkdir /usr/local/bin

if( -f /usr/lib/lpd) then
	vecho "     disabling print services..."
	mv /usr/lib/lpd /usr/lib/lpd.norun
	log "     srvss: renamed lpd"
endif

if( -f /usr/etc/keyserv) then
	vecho "     disabling keyserv..."
	mv /usr/etc/keyserv /usr/etc/keyserv.norun
	log "     srvss: renamed keyserv"
endif

if( -f /usr/etc/rpc.statd || -f /usr/etc/rpc.lockd) then
	vecho "     disabling rpc services..."
	mv -f /usr/etc/rpc.statd /usr/etc/rpc.statd.norun
	mv -f /usr/etc/rpc.lockd /usr/etc/rpc.lockd.norun
	log "     srvss: renamed rpc.statd and rpc.lockd"
endif



#
# sendmail 
#

grep "/usr/lib/sendmail -bd" /etc/rc.local | grep -v \# > /dev/null
if($status) then
	vecho "     sendmail..."
	sed "s:/usr/lib/sendmail -bd:\#       /usr/lib/sendmail  -bd:" /etc/rc.local > /tmp/rc.local
	mv /tmp/rc.local /etc/rc.local
	log "     srvss: edited sendmail out of rc.local"
endif


#
# tcsh
#

if (! -f /bin/athena/tcsh) touch /bin/athena/tcsh
diff /bin/athena/tcsh /usr/athena/bin/tcsh > /dev/null
if($status) then
	vecho "    installing tcsh..."
	install -c -m 555 /usr/athena/bin/tcsh /bin/athena
	log "     srvss: installed tcsh"	
endif


#
# /tmp
#

fgrep swap /etc/fstab | fgrep tmp > /dev/null
if($status) then
        vecho "     /tmp..."
        echo "swap    /tmp    tmp rw 0 0" >> /etc/fstab
        log "     srvss: configured /tmp/as swap"
endif


#
# update_server
#
vecho "     update_server..."
install -c -m 755 /usr/athena/etc/update_server /etc/athena
log "     srvss: installed update_server"



#
# configure version
#

vecho "     updating version..."
version add SSServer $srvssversion
echo $srvnetversstr > /etc/athena/version.txt

log "srvss: done"


if($interactive == true) then
        echo ""
        echo -n "done with the srvss configuration check. "
        get_response "Press <return> to continue..." "<return>"
endif

exit 0
