summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2014-08-22 06:27:47 -0500
committerChris Buechler <cmb@pfsense.org>2014-08-22 06:27:47 -0500
commitb6a7a5a98cb2d2423479542e81f086c32f742554 (patch)
treec672a50a170e2b5a89f6edfc85abbfd33c21f93a /etc
parent7f00d47e3d386fdc9485e559b5ca1f813041a010 (diff)
downloadpfsense-b6a7a5a98cb2d2423479542e81f086c32f742554.zip
pfsense-b6a7a5a98cb2d2423479542e81f086c32f742554.tar.gz
use pgrep here instead, previous way could wrongly show SSH as enabled where it isn't.
Diffstat (limited to 'etc')
-rwxr-xr-xetc/rc.initial6
1 files changed, 3 insertions, 3 deletions
diff --git a/etc/rc.initial b/etc/rc.initial
index 1f9f1e2..b031f6e 100755
--- a/etc/rc.initial
+++ b/etc/rc.initial
@@ -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)";
OpenPOWER on IntegriCloud