use pgrep here instead, previous way could wrongly show SSH as enabled where it isn't.
This commit is contained in:
parent
7f00d47e3d
commit
b6a7a5a98c
|
@ -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)";
|
||||
|
|
Reference in New Issue