[PC-BSD Commits] r20128 - pcbsd/branches/9.1/src-sh/warden/scripts/backend

svn at pcbsd.org svn at pcbsd.org
Wed Nov 7 08:29:00 PST 2012


Author: kris
Date: 2012-11-07 16:29:00 +0000 (Wed, 07 Nov 2012)
New Revision: 20128

Modified:
   pcbsd/branches/9.1/src-sh/warden/scripts/backend/checkstatus.sh
   pcbsd/branches/9.1/src-sh/warden/scripts/backend/chrootjail.sh
   pcbsd/branches/9.1/src-sh/warden/scripts/backend/details.sh
   pcbsd/branches/9.1/src-sh/warden/scripts/backend/startjail.sh
   pcbsd/branches/9.1/src-sh/warden/scripts/backend/stopjail.sh
Log:

MFC fixes to grep



Modified: pcbsd/branches/9.1/src-sh/warden/scripts/backend/checkstatus.sh
===================================================================
--- pcbsd/branches/9.1/src-sh/warden/scripts/backend/checkstatus.sh	2012-11-07 16:28:27 UTC (rev 20127)
+++ pcbsd/branches/9.1/src-sh/warden/scripts/backend/checkstatus.sh	2012-11-07 16:29:00 UTC (rev 20128)
@@ -39,7 +39,7 @@
 done
 
 # Check if the jail is active
-jls | grep ${JDIR}/${IP} >/dev/null 2>/dev/null
+jls | grep ${JDIR}/${IP}$ >/dev/null 2>/dev/null
 if [ "$?" = "0" -o "$hasmount" = "1" ]; then
   exit 0
 else

Modified: pcbsd/branches/9.1/src-sh/warden/scripts/backend/chrootjail.sh
===================================================================
--- pcbsd/branches/9.1/src-sh/warden/scripts/backend/chrootjail.sh	2012-11-07 16:28:27 UTC (rev 20127)
+++ pcbsd/branches/9.1/src-sh/warden/scripts/backend/chrootjail.sh	2012-11-07 16:29:00 UTC (rev 20128)
@@ -32,7 +32,7 @@
 set_warden_metadir
 
 # Make sure the jail is running
-jls | grep ${JDIR}/${IP} >/dev/null 2>/dev/null
+jls | grep ${JDIR}/${IP}$ >/dev/null 2>/dev/null
 if [ "$?" != "0" ]
 then
   echo "ERROR: Jail is not running!"
@@ -40,7 +40,7 @@
 fi
 
 # Get the JailID for this jail
-JID="`jls | grep ${JDIR}/${IP} | tr -s " " | cut -d " " -f 2`"
+JID="`jls | grep ${JDIR}/${IP}$ | tr -s " " | cut -d " " -f 2`"
 
 # If on an portjail, make display available
 if [ -e "${JMETADIR}/jail-portjail" ] ; then

Modified: pcbsd/branches/9.1/src-sh/warden/scripts/backend/details.sh
===================================================================
--- pcbsd/branches/9.1/src-sh/warden/scripts/backend/details.sh	2012-11-07 16:28:27 UTC (rev 20127)
+++ pcbsd/branches/9.1/src-sh/warden/scripts/backend/details.sh	2012-11-07 16:29:00 UTC (rev 20128)
@@ -35,7 +35,7 @@
 isDirZFS "${JDIR}/${IP}" "1"
 if [ $? -eq 0 ] ; then 
    tank=`getZFSTank "${JDIR}/${IP}"`
-   diskUsage=`df -m | grep -w ${tank}${JDIR}/${IP} | awk '{print $3}'`
+   diskUsage=`df -m | grep -w ${tank}${JDIR}/${IP}$ | awk '{print $3}'`
 else
    diskUsage=`du -c -x -m ${JDIR}/${IP} 2>/dev/null | grep total | tail -n 1 | awk '{print $1}'`
 fi

Modified: pcbsd/branches/9.1/src-sh/warden/scripts/backend/startjail.sh
===================================================================
--- pcbsd/branches/9.1/src-sh/warden/scripts/backend/startjail.sh	2012-11-07 16:28:27 UTC (rev 20127)
+++ pcbsd/branches/9.1/src-sh/warden/scripts/backend/startjail.sh	2012-11-07 16:29:00 UTC (rev 20128)
@@ -37,7 +37,7 @@
 fi
 
 # Make sure the jail is NOT already running
-jls | grep ${JDIR}/${IP} >/dev/null 2>/dev/null
+jls | grep ${JDIR}/${IP}$ >/dev/null 2>/dev/null
 if [ "$?" = "0" ]
 then
   echo "ERROR: Jail appears to be running already!"
@@ -137,7 +137,7 @@
    exit 1
 fi
 
-JID="`jls | grep ${JDIR}/${IP} | tr -s " " | cut -d " " -f 2`"
+JID="`jls | grep ${JDIR}/${IP}$ | tr -s " " | cut -d " " -f 2`"
 
 if [ "$LINUXJAIL" = "YES" ] ; then
   # If we have a custom start script

Modified: pcbsd/branches/9.1/src-sh/warden/scripts/backend/stopjail.sh
===================================================================
--- pcbsd/branches/9.1/src-sh/warden/scripts/backend/stopjail.sh	2012-11-07 16:28:27 UTC (rev 20127)
+++ pcbsd/branches/9.1/src-sh/warden/scripts/backend/stopjail.sh	2012-11-07 16:29:00 UTC (rev 20128)
@@ -42,7 +42,7 @@
 echo -e "Stopping the jail...\c"
 
 # Get the JailID for this jail
-JID="`jls | grep ${JDIR}/${IP} | tr -s " " | cut -d " " -f 2`"
+JID="`jls | grep ${JDIR}/${IP}$ | tr -s " " | cut -d " " -f 2`"
 
 echo -e ".\c"
 



More information about the Commits mailing list