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

This commit is contained in:
Renato Botelho 2014-08-22 10:53:39 -03:00
parent a762649bb0
commit a94b9befbd
1 changed files with 1 additions and 2 deletions

View File

@ -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)";