[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [ezjail] Multiple flavours and version 3.1



----------------------------------------
> Date: Fri, 12 Feb 2010 19:26:00 +0200
> From: p.christias AT noc.ntua DOT gr
> To: ezjail AT erdgeist DOT org
> Subject: Re: [ezjail] Multiple flavours and version 3.1
>
> Here too.
>
> Nestor Wheelock - 314-558-4850 x501 wrote:
>> That would be helpful in my setup (and not annoying).
>>
>> -Nestor
>>
>>> ----------------------------------------
>>>> From: andrew.hotlab AT hotmail DOT com
>>>> To: ezjail AT erdgeist DOT org
>>>> Date: Thu, 11 Feb 2010 17:02:24 +0000
>>>> Subject: RE: [ezjail] Multiple flavours and version 3.1
>>>>
>>> How do you think about displaying the FIB number associated with each
>> jail in a dedicated column in the output of the ezjail-admin list? (maybe
>> before the IP address field)
>>> This would eat up 5 characters, which might be subtracted from the
>>> "Hostname" field, and would help administrators to immediately detect if
>> a jail is associated to the correct FIB.
>>>
>>> Obviously, if you do not use multiple FIBs on your host you might be
>>> annoyed by this "useless" info displayed in the list, but I think it is
>>> worth it.
>>>
>>> If anyone think it would be an useful thing, I'll be glad to write the
>>> patch as soon as possible (I'm not a script master, but I should be able
>> to do this change).
>>>
>>
>

Ok. This small patch should do the trick:

--- ezjail-admin        2010/02/12 23:07:00     1.249
+++ ezjail-admin        2010/02/12 23:19:58
@@ -777,8 +777,8 @@

   [ -d "${ezjail_prefix}/etc/ezjail/" ] && cd "${ezjail_prefix}/etc/ezjail/" && ezjail_list=`ls | xargs rcorder`

-  printf "%-3s %-4s %-15s %-30s %s\\n" STA JID IP Hostname "Root Directory"
-  echo   "--- ---- --------------- ------------------------------ ------------------------"
+  printf "%-3s %-4s %-4s %-15s %-25s %s\\n" STA JID FIB IP Hostname "Root Directory"
+  echo   "--- ---- ---- --------------- ------------------------- ------------------------"
   for ezjail in ${ezjail_list}; do
     fetchjailinfo ${ezjail%.norun}
     case ${ezjail_imagetype} in simple) ezjail_state="I";; bde) ezjail_state="B";; eli) ezjail_state="E";; *) ezjail_state="D";; esac
@@ -792,10 +792,10 @@
     TIFS=${IFS}; IFS=,; unset _multiline
     for ezjail_ip in ${ezjail_ips:="-"}; do
       if [ -z "${_multiline}" ]; then
-        printf "%-3s %-4s %-15s %-30s %s\\n" "${ezjail_state}" "${ezjail_id:-N/A}" "${ezjail_ip}" "${ezjail_hostname}" "${ezjail_rootdir}"
+        printf "%-3s %-4s %-4s %-15s %-25s %s\\n" "${ezjail_state}" "${ezjail_id:-N/A}" "${ezjail_fib}" "${ezjail_ip}" "${ezjail_hostname}" "${ezjail_rootdir}"
         _multiline=yes
       else
-        printf "    %-4s %s\\n" "${ezjail_id:-N/A}" "${ezjail_ip}"
+        printf "    %-4s %-4s %s\\n" "${ezjail_id:-N/A}" "${ezjail_fib}" "${ezjail_ip}"
       fi
     done
     IFS=${TIFS}


I've just tested it in various conditions (started and stopped jails, multi-ip jails, etc.), and it seems to work.
As I wrote, I'm not a script expert: I've merely extended what somebody already wrote, barely understanding the meaning of the code... please be kind! :)


Andrew

 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969