#!/bin/sh
##############################################################################
# $Id: disable_inetd,v 1.1 2002/03/21 19:04:14 root Exp $
##############################################################################
# Shutdown inetd and try to make sure it never comes back
##############################################################################
# $Log: disable_inetd,v $
# Revision 1.1  2002/03/21 19:04:14  root
# Initial revision
#
##############################################################################

echo
echo "Start of $0"
echo '  $Id: disable_inetd,v 1.1 2002/03/21 19:04:14 root Exp $'

BASE=/a

echo "  Disabling inetd"
cp -p $BASE/etc/init.d/inetsvc $BASE/etc/init.d/inetsvc.orig
sed 's,^/usr/sbin/inetd,#/usr/sbin/inetd,' $BASE/etc/init.d/inetsvc > $BASE/etc/init.d/inetsvc.new
mv $BASE/etc/init.d/inetsvc.new $BASE/etc/init.d/inetsvc
chmod 744 $BASE/etc/init.d/inetsvc
$SI_CONFIG_DIR/finish/scripts/relink_init_script inetsvc

# Comment out everything in inetd.conf and move it to inetd.conf-disabled
# That way, if someone copies it back and tries to start it back up there
# won't be any services enabled.  Then they'll be forced to only uncomment
# whatever it is they really need instead of starting everything.
echo "  Commenting out all services in /etc/inet/inetd.conf and moving "
echo "  it to inetd.conf-disabled"
mv $BASE/etc/inet/inetd.conf $BASE/etc/inet/inetd.conf.orig
sed '/^[^#]/s/^/#/' $BASE/etc/inet/inetd.conf.orig > $BASE/etc/inet/inetd.conf-disabled
chmod 644 $BASE/etc/inet/inetd.conf-disabled

echo "End of $0"

