#!/bin/ash
. /usr/local/bin/sig_catcher


telnet_count=`ps | grep "rlm_gdb -i -x" | grep -v grep | wc -l`
ssh_count=`ps | grep "rlm_gdb -x" | grep -v grep | wc -l`

if [ $telnet_count -gt 0 ]
then
	echo GDB service is active in telnet mode.
fi

if [ $ssh_count -gt 0 ]
then
	echo GDB service is active in SSH mode.
fi

if [ $telnet_count -eq 0 ]
then
	if [ $ssh_count -eq 0 ]
	then
		echo GDB service is not active.
	fi
fi
