2019-01-04 13:51:05 +01:00
|
|
|
#!/bin/sh
|
2019-01-07 14:47:05 +01:00
|
|
|
#
|
|
|
|
# Reload jail <jailname> or all
|
|
|
|
# Usage: reload <jailname>|all
|
|
|
|
#
|
2019-01-04 13:51:05 +01:00
|
|
|
|
2020-04-01 11:23:35 +02:00
|
|
|
# shellcheck source=./config
|
2020-04-02 00:31:57 +02:00
|
|
|
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
|
2019-01-04 13:51:05 +01:00
|
|
|
|
|
|
|
jail="${1:-}"
|
2019-01-07 14:47:05 +01:00
|
|
|
if [ ! -n "${jail}" ]; then
|
|
|
|
"${LIBDIR}/bkctld-help" && exit 1
|
|
|
|
fi
|
2019-01-07 16:41:29 +01:00
|
|
|
[ -d "${JAILDIR}/${jail}" ] || error "${jail} : trying to reload inexistant jail"
|
2019-01-07 16:34:14 +01:00
|
|
|
"${LIBDIR}/bkctld-is-on" "${jail}" || exit 0
|
2019-01-04 13:51:05 +01:00
|
|
|
|
|
|
|
pid=$(cat "${JAILDIR}/${jail}/${SSHD_PID}")
|
|
|
|
|
|
|
|
kill -HUP "${pid}" && notice "${jail} was reloaded [${pid}]"
|