Use at your own risk...
#!/bin/sh
# Created By Ke Carlton 2010
# ke * zeroloop.com
echo ""
echo "Lasso Zombie Child Thread Killer"
echo "-----------------------------------"
echo "WARNING: You *must* have installed the LassoServe_pid routine within each LassoSite"
echo "startup folder: http://tagswap.net/RD_lassoService_pid otherwise this rountine"
echo "will simply continuous kill the Lasso sites... "
echo ""
sleep 1 ; echo -n "3...";
sleep 1 ; echo -n "2...";
sleep 1 ; echo -n "1...";
sleep 1 ; echo "!";
index=0
allLassoProcesses=( $( ps -u lasso -o pid,command | grep Lasso | awk '{ print $1}' ) )
# Work of lasso_pid files
for myfile in /tmp/LassoService8_*.pid
do
validLassoProcesses[$index]=`cat $myfile`
index=$(($index+1))
done
echo "allLassoProcesses: ${allLassoProcesses[*]}"
echo "validLassoProcesses: ${validLassoProcesses[*]}"
for pid in "${allLassoProcesses[@]}"
do
valid=0
for vpid in "${validLassoProcesses[@]}"
do
# Remove back slashes below
if [\[ $vpid = $pid ]\] ; then
valid=1
fi;
done
# Remove back slashes below
if [\[ $valid == 0 ]\] ; then
echo "Killing PID $pid";
echo "$pid" | xargs kill
fi;
done
echo "Done"
echo ""
Author: Ke Carlton
Created: 27 Apr 2010
Last Modified: 16 Mar 2011
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft