From f2dde50ffc58004d6f0fe85e4ee7b9b7c7577ee1 Mon Sep 17 00:00:00 2001 From: Culsu Date: Mon, 14 Oct 2024 23:42:08 +0200 Subject: [PATCH] fixed an error where jaildk status was trying to find a jail called v6, also fixed some column alignment when printing the status --- src/jaildk.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/jaildk.sh b/src/jaildk.sh index 234cb9f..58d78c5 100755 --- a/src/jaildk.sh +++ b/src/jaildk.sh @@ -1286,15 +1286,14 @@ jaildk_jail() { jail=$2 if test "x$mode" = "xstatus"; then + if test -z "$jail" -o "$jail" = "-h"; then + bold "Running jails:" + lookup='*' + else + bold "Status of $jail:" + lookup=$jail + fi ( - if test -z "$jail" -o "$jail" = "-h"; then - bold "Running jails:" - lookup='*' - else - bold "Status $jail:" - lookup=$jail - fi - echo "Jail IP-Address Path Is-Running RW-mounted Current-Version Base" grep -h "name=" $j/etc/$lookup/jail.conf | cut -d= -f2 | while read jail; do jid='' @@ -1317,7 +1316,7 @@ jaildk_jail() { if jls -j $jail > /dev/null 2>&1; then # jail is running, get some data about jail - eval $(jls -j v6 -qn ip4.addr ip6.addr jid) + eval $(jls -j $jail -qn ip4.addr ip6.addr jid path | sed 's/\.addr/addr/g') if test -n "$ip4addr"; then ip=$ip4addr else