[KLUG Members] Help for a shell script to stop and start process

Komal agencies_ad1 at sancharnet.in
Mon Oct 10 01:45:35 EDT 2005


Hi,
A script is needed which comments the second line of
the file and removes ones condition is fulfilled..
For example as mentioned down, I'm checking for the
free memory, when it comes to some 50MB it should the
comment the '#' at second line of the file
/service/run and when the free memory comes to 200 it
should remove '#' killing the process or perl.
The script below is incomplete..

#!/bin/bash

echo RAM=`grep MemFree /proc/meminfo|tr -s
[:blank:]|cut -f2 -d" "`
echo SWAP=`grep SwapFree /proc/meminfo|tr -s
[:blank:]|cut -f2 -d" "`
echo PID=`pidof perl`
if [ $RAM le= 563200 ]
then wall "Free Memory is at 100"
elif [ $RAM=530432 ]
fi

Thanks

Regards,

Komal



More information about the Members mailing list