summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-08-22 10:53:39 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-08-22 10:53:51 -0300
commita94b9befbdee3beaea5741e105336c7fba77e3de (patch)
tree20428ab7d11938d131aaad3fec2f9718c08ea4fe /etc
parenta762649bb0a9a79a662f4a4d6cf69eba87696480 (diff)
downloadpfsense-a94b9befbdee3beaea5741e105336c7fba77e3de.zip
pfsense-a94b9befbdee3beaea5741e105336c7fba77e3de.tar.gz
pgrep parameters are out of order and it also needs -a to find sshd. While I'm here, simplify sh syntax and prevent noise to be printed if pid file doesn't exist
Diffstat (limited to 'etc')
-rwxr-xr-xetc/rc.initial3
1 files changed, 1 insertions, 2 deletions
diff --git a/etc/rc.initial b/etc/rc.initial
index b031f6e..f79b33a 100755
--- a/etc/rc.initial
+++ b/etc/rc.initial
@@ -62,8 +62,7 @@ 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 running.
-SSHD=`/bin/pgrep sshd -F /var/run/sshd.pid`
-if [ "$?" == "0" ]; then
+if pgrep -q -a -F /var/run/sshd.pid sshd >/dev/null 2>&1; then
sshd_option="14) Disable Secure Shell (sshd)";
else
sshd_option="14) Enable Secure Shell (sshd)";
OpenPOWER on IntegriCloud