From b3529f213164f71375dc5b553869242ee98c94cc Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Fri, 1 May 2020 09:51:36 +0200 Subject: [PATCH] bkctld-is-on returns code 100 if jail is stopped --- lib/bkctld-is-on | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/bkctld-is-on b/lib/bkctld-is-on index 6a80569..9a96b05 100755 --- a/lib/bkctld-is-on +++ b/lib/bkctld-is-on @@ -18,12 +18,13 @@ test -d "${jail_path}" || error "${jail_name}: jail not found" 2 jail_pid_file="${jail_path}/${SSHD_PID}" -return=1 +# Error codes are references in "includes" file +return=100 if [ -f "${jail_pid_file}" ]; then pid=$(cat "${jail_pid_file}") ps -p "${pid}" > /dev/null && return=0 fi -if [ "${return}" -eq 1 ]; then +if [ "${return}" -gt 0 ]; then rm -f "${jail_pid_file}" grep -q "${jail_path}/proc" /proc/mounts && umount --lazy "${jail_path}/proc/" grep -q "${jail_path}/dev" /proc/mounts && umount --lazy --recursive "${jail_path}/dev"