2019-01-04 13:51:05 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
LIBDIR="$(dirname $0)" && . "${LIBDIR}/config"
|
|
|
|
|
|
|
|
jail="${1:-}"
|
|
|
|
[ -n "${jail}" ] || usage
|
|
|
|
check_jail "${jail}" || error "${jail} : trying to stop inexistant jail"
|
2019-01-04 16:00:31 +01:00
|
|
|
check_jail_on "${jail}" || exit 0
|
2019-01-04 13:51:05 +01:00
|
|
|
|
|
|
|
pid=$(cat "${JAILDIR}/${jail}/${SSHD_PID}")
|
|
|
|
for conn in $(ps --ppid "${pid}" -o pid=); do
|
|
|
|
kill "${conn}"
|
|
|
|
done
|
|
|
|
kill "${pid}" && notice "${jail} was stopped [${pid}]"
|
|
|
|
umount --lazy --recursive "${JAILDIR}/${jail}/dev"
|
|
|
|
umount --lazy "${JAILDIR}/${jail}/proc/"
|