[PC-BSD Commits] r4285 - pcbsd/trunk/system-overlay/usr/PCBSD/Scripts

svn at pcbsd.org svn at pcbsd.org
Thu Jul 30 06:42:32 PDT 2009


Author: kris
Date: 2009-07-30 06:42:31 -0700 (Thu, 30 Jul 2009)
New Revision: 4285

Modified:
   pcbsd/trunk/system-overlay/usr/PCBSD/Scripts/swapmonitor.sh
Log:

Fixed the swapmonitor script to run on PC/FreeBSD 8.x



Modified: pcbsd/trunk/system-overlay/usr/PCBSD/Scripts/swapmonitor.sh
===================================================================
--- pcbsd/trunk/system-overlay/usr/PCBSD/Scripts/swapmonitor.sh	2009-07-29 18:46:18 UTC (rev 4284)
+++ pcbsd/trunk/system-overlay/usr/PCBSD/Scripts/swapmonitor.sh	2009-07-30 13:42:31 UTC (rev 4285)
@@ -18,12 +18,12 @@
 z=1
 do
 
-sleep 2
+sleep 5
 
 # Run the swapctl command and save output
 SWAPOUTPUT="`swapctl -s -h`"
-SWAPTOTAL="`echo ${SWAPOUTPUT} | awk '{ print $2 }'`"
-SWAPUSED="`echo ${SWAPOUTPUT} | awk '{ print $3 }'`"
+SWAPTOTAL="`echo ${SWAPOUTPUT} | awk '{ print $2 }' | sed -e 's|M||g' | sed -e 's|B||g' | sed -e 's|G||g'`"
+SWAPUSED="`echo ${SWAPOUTPUT} | awk '{ print $3 }' | sed -e 's|M||g' | sed -e 's|B||g' | sed -e 's|G||g'`"
 SWAPAVAIL="`expr ${SWAPTOTAL} - ${SWAPUSED}`"
 
 if [ ${SWAPAVAIL} -lt 200 ]



More information about the Commits mailing list