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:28:39 -0500
commit61b2ed1c59430f2e0b902a6ed7671f3fb1dd2705 (patch)
tree2baef25cbc906f3c6704070a74d23ab7e36c136b /etc
parent0b252f7a3aa31037789a7a03b8c5bbafbeb653ad (diff)
downloadpfsense-61b2ed1c59430f2e0b902a6ed7671f3fb1dd2705.zip
pfsense-61b2ed1c59430f2e0b902a6ed7671f3fb1dd2705.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 03d9131..8388f71 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