#!/bin/bash # # Compilerz v.0.2 <03.07.06> # by Esteban Borges # # Simple script que busca scripts y archivos compilados en # directorios temporales del servidor web (/tmp, /var/tmp, /dev/shm) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US RUTA="$HOME/compiler.log" function buscar () { for afdir in /tmp /var/tmp /dev/shm; do for i in `ls $afdir`; do file $afdir/$i; done | egrep -i 'script|executable|program'; done; } buscar > $RUTA if [ $(cat $RUTA | wc -w) -eq 0 ]; then echo "Sus directorios temporales estan LIMPIOS [ OK ] " rm $RUTA -f else echo "Sus directorios temporales CONTIENEN SCRIPTS Y/O PROGRAMAS [ ATENCION ] " echo "-----------------------------------------------------------------------" echo "$(cat $RUTA)" rm $RUTA -f exit fi