use pgrep here instead, previous way could wrongly show SSH as enabled where it isn't.

This commit is contained in:
Chris Buechler 2014-08-22 06:27:47 -05:00
parent 7f00d47e3d
commit b6a7a5a98c
1 changed files with 3 additions and 3 deletions

View File

@ -61,9 +61,9 @@ fi
product=`grep product_name /etc/inc/globals.inc | cut -d'"' -f4`
hidebanner=`grep hidebanner /etc/inc/globals.inc | cut -d'"' -f4`
# Check to see if SSH is listening.
SSHD=`/usr/bin/sockstat -4l | grep "*.22" | wc -l`
if [ "$SSHD" -gt 0 ]; then
# Check to see if SSH is running.
SSHD=`/bin/pgrep sshd -F /var/run/sshd.pid`
if [ "$?" == "0" ]; then
sshd_option="14) Disable Secure Shell (sshd)";
else
sshd_option="14) Enable Secure Shell (sshd)";