Add a header for bktcld status output.

This commit is contained in:
William Hirigoyen (Evolix) 2021-12-03 15:16:59 +01:00
parent 4f9b56d7a4
commit 0b777b4a3f
2 changed files with 2 additions and 1 deletions

1
bkctld
View File

@ -116,6 +116,7 @@ case "${subcommand}" in
;;
"status")
jail_name="${2:-}"
printf '%-30s %-10s %-10s %-10s %-40s\n' 'Jail name' 'Status' 'Port' 'Retention policy (day/month)' 'IP'
if [ "${jail_name}" = "all" ] || [ -z "${jail_name}" ]; then
for jail in $("${LIBDIR}/bkctld-list"); do
"${LIBDIR}/bkctld-${subcommand}" "${jail}"

View File

@ -18,7 +18,7 @@ incs_policy="0"
if [ -r "${incs_policy_file}" ]; then
days=$(grep "^\+" "${incs_policy_file}" | grep --count "day")
months=$(grep "^\+" "${incs_policy_file}" | grep --count "month")
incs_policy="${days}d/${months}m"
incs_policy="${days}/${months}"
fi
status="OFF"