#!/bin/sh
#
# This is the main search script for fas.php
#
# First argument supplied to this script is the directory where the list
# files are located. Second argument is the search term.
#
# For advanced features uncomment and edit some of the lines further below.
#
# Example: To include your latest downloads to /home/myusername/downloads
# in the search, uncomment the two lines below. This way the list file
# for this subdir will be recreated before each search, so that the search
# results always represent the current state - great for directories where
# a lot of things change (e.g upload directories of an FTP site).
# Note that if the directory /home/myusername/downloads is very large,
# then searches will get very slow. Use with care.
#
# cd /home/myusername/downloads
# LANG=C ls -lR >$1/downloads
# 
# The following might also be useful for a very special case:
#
# cd /glftpd/site/incoming
# LANG=C ls -lR >$1/incoming
#
#
# Do not edit anything below this line (unless you know what you're doing).

cd $1
grep -i -E $2 *
