Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- Header ()
- {
- echo -en "Content-Type: text/html\r\n\r\n"
- echo "<html><head><title>test</title></head><body>"
- }
- IsDirectoryMatch ()
- {
- case "$1" in
- */) return 0 ;;
- *) return 1 ;;
- esac
- }
- IsDirectory ()
- {
- result=$(ls -dp $1)
- IsDirectoryMatch "$result"
- }
- Main ()
- {
- for file in "../$QUERY_STRING"/*
- do
- b=${file##*/}
- #echo "<a href='../$b'>$b</a><br/>"
- if IsDirectory "$file" ; then
- echo "<a href='test.cgi?$QUERY_STRING/$b'>$b</a><br/>"
- else
- echo "<a href='$QUERY_STRING/$b'>$b</a><br/>"
- fi
- done
- echo "</body></html>";
- }
- Header
- Main
- # End of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement