Merge pull request #1869 from ich777/ich777-rc.sshd-fix

Fix for rc.sshd
This commit is contained in:
tom mortensen
2024-09-26 12:25:09 -07:00
committed by GitHub

View File

@@ -26,7 +26,7 @@ sshd_running(){
# get all pids from sshd
for pid in $(pgrep -f $SSHD); do
# check if a sshd is running on host system
if ! grep -qE '/docker/|/lxc/' /proc/$pid/cgroup; then
if ! grep -qE '/docker|/lxc' /proc/$pid/cgroup; then
return 0
fi
done
@@ -77,7 +77,7 @@ sshd_stop(){
# get all pids from sshd
for pid in $(pgrep -f $SSHD); do
# make sure to kill only sshd from host system
if ! grep -qE '/docker/|/lxc/' /proc/$pid/cgroup; then
if ! grep -qE '/docker|/lxc' /proc/$pid/cgroup; then
kill $pid
fi
done