From cea94f977ddbc4964c2d20927cf287807377bc7f Mon Sep 17 00:00:00 2001
From: erdgeist <erdgeist@erdgeist.org>
Date: Sat, 14 Jan 2012 20:00:55 +0000
Subject: Fix regex to grep for pids in a running Jail. Thanks to Thomas Steen
 Rasmussen.

---
 ezjail-admin | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ezjail-admin b/ezjail-admin
index c923506..1748436 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -729,10 +729,10 @@ EOF
     jail_pids=`pgrep $jail_ids`
 
     # expand pids to form a greppable expression
-    jail_grep=`echo $jail_pids | sed -E -e"s/ /)|(/g" -e"s/^/(/" -e"s/$/)/"`
+    jail_grep=`echo $jail_pids | sed -E -e"s/ / )|( /g" -e"s/^/( /" -e"s/$/ )/"`
 
     IFS=_
-    ezjail_listener=`sockstat -46l | grep -E -e "\*:[[:digit:]]" | grep -E -e " ${jail_grep} "`
+    ezjail_listener=`sockstat -46l | grep -E -e "\*:[[:digit:]]" | grep -E -e "${jail_grep}"`
     [ $? -eq 0 ] && echo -e "Warning: Some services already seem to be listening on all IP, (including ${ezjail_ip})\n  This may cause some confusion, here they are:\n${ezjail_listener}"
     IFS=,
   done
-- 
cgit v1.2.3