#!/bin/sh

if [ 1 -eq `grep -c '^telnet' /etc/athena/inetd.conf` ]; then
  echo "Disabling telnetd in /etc/athena/inetd.conf"
  ed -s /etc/athena/inetd.conf << EOS
/^telnet/s/^/#/
w
q
EOS
  kill -HUP `cat /var/athena/inetd.pid`
  echo "Please verify that telnetd is disabled by running 'telnet localhost'"
  echo "and checking that you get a 'Connection refused' error."
else
  echo "telnetd does not appear to be enabled.  Please verify that this is"
  echo "the case by running 'telnet localhost' and checking that you get a"
  echo "'Connection refused' error."
fi
