Add --no-header option for status command.
continuous-integration/drone/push Build is passing Details
gitea/evobackup/pipeline/head This commit looks good Details

This commit is contained in:
William Hirigoyen 2022-10-27 17:10:14 +02:00
parent f683691853
commit aff5dbba95
4 changed files with 14 additions and 2 deletions

View File

@ -49,6 +49,12 @@ You can deploy test environments with Vagrant :
vagrant up
~~~
To destroy Vagrant VMs :
~~~
vagrant destroy
~~~
### Deployment
Run `vagrant rsync-auto` in a terminal for automatic synchronization of

View File

@ -53,6 +53,9 @@ while :; do
-f|--force)
export FORCE=1
;;
--no-header)
export HEADER=0
;;
*)
# Default case: If no more options then break out of the loop.
break
@ -116,7 +119,9 @@ case "${subcommand}" in
;;
"status")
jail_name="${2:-}"
printf '%-30s %-10s %-10s %-25s %-20s\n' 'JAIL NAME' 'STATUS' 'PORT' 'RETENTION (DAY/MONTH)' 'IP'
if [ "${HEADER}" = "1" ]; then
printf '%-30s %-10s %-10s %-25s %-20s\n' 'JAIL NAME' 'STATUS' 'PORT' 'RETENTION (DAY/MONTH)' 'IP'
fi
if [ "${jail_name}" = "all" ] || [ -z "${jail_name}" ]; then
for jail in $("${LIBDIR}/bkctld-list"); do
"${LIBDIR}/bkctld-${subcommand}" "${jail}"

View File

@ -1,7 +1,7 @@
#!/bin/sh
#
# Description: Display status of SSH server
# Usage: status [<jailname>|all]
# Usage: [--no-header] status [<jailname>|all]
#
# shellcheck source=./includes

View File

@ -29,6 +29,7 @@ CRITICAL="${CRITICAL:-48}"
WARNING="${WARNING:-24}"
DUC=$(command -v duc-nox || command -v duc)
FORCE="${FORCE:-0}"
HEADER="${HEADER:-1}"
show_version() {
cat <<END