Révision b6a7a5a9
Ajouté par Chris Buechler il y a plus de 9 ans
etc/rc.initial | ||
---|---|---|
61 | 61 |
product=`grep product_name /etc/inc/globals.inc | cut -d'"' -f4` |
62 | 62 |
hidebanner=`grep hidebanner /etc/inc/globals.inc | cut -d'"' -f4` |
63 | 63 |
|
64 |
# Check to see if SSH is listening.
|
|
65 |
SSHD=`/usr/bin/sockstat -4l | grep "*.22" | wc -l`
|
|
66 |
if [ "$SSHD" -gt 0 ]; then
|
|
64 |
# Check to see if SSH is running.
|
|
65 |
SSHD=`/bin/pgrep sshd -F /var/run/sshd.pid`
|
|
66 |
if [ "$?" == "0" ]; then
|
|
67 | 67 |
sshd_option="14) Disable Secure Shell (sshd)"; |
68 | 68 |
else |
69 | 69 |
sshd_option="14) Enable Secure Shell (sshd)"; |
Formats disponibles : Unified diff
use pgrep here instead, previous way could wrongly show SSH as enabled where it isn't.