#!/bin/bash
#Stefan Bauer - duke@splatterworld.de
#2004-07-15
#
MY_NEWFILE="newdirs"
MY_OUTPUT="output"
MY_HITS="hits"
if [ -e "$MY_NEWFILE" ]
then
	rm newdirs output hits 
else
echo
fi
echo " ** Directory scanner version 1.0 loaded ** "
echo 
echo "keep in mind to create a file called"
echo "dirlist first, and insert example dir's like"
echo "mp3 test songs pics private"
echo
echo "checking if dirlist file is available"
echo

MY_FILE="dirlist"
echo -n "Exist $MY_FILE ? .."
if [ -e "$MY_FILE" ]
then
	echo "file available - going to next step"
echo
else

	echo "file not available - please create first!"
exit
echo
fi
echo $NAME
echo -e "Hostname to scan (expample: http://www.plzk.de): "
read a
if [ "$a" != "" ]
then
        MY_HOSTNAME="$a"
fi
echo "Using  $MY_HOSTNAME as hostname."
echo
for CURR_LINE in $(cat "$MY_FILE") ; do
echo "${MY_HOSTNAME}/${CURR_LINE}" >> "$MY_NEWFILE"
done
wget -q -S -i newdirs -O output
HOST=$(echo "$MY_HOSTNAME" | sed -e 's/http:\/\///i')
touch "$HOST" 
cat output | grep -F Index >> "$HOST" 
echo "available directorys on $MY_HOSTNAME are stored in file $HOST"
echo


