#!/bin/sh

CR="$(printf '\r')"

read method pfad protocol

echo HTTP/1.1 200 OK
echo Content-Type: text/plain
echo

if   test -d "$pfad"; then
  ls "$pfad"

elif test -f "$pfad"; then
  less "$pfad"

elif test -b "$pfad"; then
  echo "$pfad ist ein Datenträger"

else
  echo "Pfad existiert nicht" >&2
  exit 2

fi
