#!/bin/bash

#used for cli command "set system services telnet disable "
#input $1:"true" or "false"

# "true" kills telnetd
if [[ x"$1" == x"true" ]] ; then
    sed -i "s/disable.*/disable = yes/" /etc/xinetd.d/telnet
     /etc/init.d/xinetd stop > /dev/null
     sleep 1
elif [[ x"$1" == x"false" ]]; then
    sed -i "s/disable.*/disable = no/" /etc/xinetd.d/telnet
     /etc/init.d/xinetd restart > /dev/null
     sleep 1
fi                                                   
      
exit 0
