#!/bin/sh

# This script intended to remove all .rhosts & .shosts from your system. Just a hack to remove
# any hole-like user/system files.
# (c) Light Olli , olli@digger.org.ru

chrootdir=/users/userchroot
FPATH=`ls -1 / | grep -v proc | grep -v users | awk -- '{print " /" $0;}'| tr -d '\n'`
FCHRTPATH=`ls -1 $chrootdir | grep -v proc | awk -- '{print " /" $0;}'| tr -d '\n'`
# we can't do just "-path '*/proc' -prune"  in cause this 'll skip all .[rs]hosts in */proc:
# thus doing following:
find $FPATH -type f -a \( -name .rhosts -o -name .shosts \) -print -exec rm -fv {} \;
/usr/sbin/chroot $chrootdir find $FCHRTPATH -type f -a \( -name .rhosts -o -name .shosts \) -print -exec rm -fv {} \;
