Fix for rc.sshd

- Remove trailing slash to be sure to grab the correct PIDs
This commit is contained in:
Christoph Hummer
2024-09-23 22:16:02 +02:00
committed by GitHub
parent 8f656e87b1
commit a75bc3d4d7

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