#!/bin/bash -
# locate.sh by Usurper (November 1999)

#This small script will find files that the user gives on the command line.
#exmp: "site locate abcdefg.zip" will tell you where this file is.
#You can also use wildcards, like "site locate abcd*".

#NOTE: make sure you have /glftpd/dev/null and that it's globally writable
#(chmod 666 /glftpd/dev/null)

#Change "sitepath" to where the script should search for the files.
#exmp: sitepath=/site
sitepath=/site

#Change "pathsize" to the number of characters that will be stripped
#from each file found.  For example, if you want "/site/incoming/file.zip"
#to appear as "/incoming/file.zip", set pathsize to 5.
pathsize=5

echo -e "Hold on, this might take a while...\r"
find ${sitepath} -name $1 -exec echo -e \{\} \; 2>/dev/null | cut -c${pathsize}-
