#!/bin/sh
##############################################################################
# $Id: enable_inetd_service,v 1.1 2002/03/21 19:07:10 root Exp $
##############################################################################
# Uncomment a specific service from inetd.  Generally would be used after
# disable_inetd_services is run to selectively re-enable certain services.
#
# It looks for '^#$1[ \t]' when looking for inetd.conf
##############################################################################
# $Log: enable_inetd_service,v $
# Revision 1.1  2002/03/21 19:07:10  root
# Initial revision
#
##############################################################################

echo
echo "Start of $0"
echo '  $Id: enable_inetd_service,v 1.1 2002/03/21 19:07:10 root Exp $'

BASE=/a

if [ -z "$1" ]
then
	echo "  No service specified" >&2
	exit
fi

echo "  Enabling inetd service $1"

# Some of the RPC services have forward slashes in them, which we need to
# escape
service=`echo $1 | sed 's,/,\\\/,'`
sed "/^#$service[ 	]/s/^#//" $BASE/etc/inet/inetd.conf > $BASE/etc/inet/inetd.conf.new
mv $BASE/etc/inet/inetd.conf.new $BASE/etc/inet/inetd.conf

echo "End of $0"

