evobackup/lib/bkctld-status

18 lines
489 B
Bash
Executable file

#!/bin/sh
LIBDIR="$(dirname $0)" && . "${LIBDIR}/config"
jail="${1:-}"
[ -n "${jail}" ] || usage
check_jail "${jail}" || error "${jail} : inexistant jail ! Use '$0 status' for list all"
inc=$(get_inc "${jail}")
if ( check_jail_on "${jail}" ); then
status="ON "
else
status="OFF"
fi
port=$(get_port "${jail}")
ip=$(get_ip "${jail}"|xargs|tr -s ' ' ',')
echo "${jail} ${status} ${port} ${inc} ${ip}" | awk '{ printf("%- 30s %- 10s %- 10s %- 10s %- 40s\n", $1, $2, $3, $4, $5); }'