excess.org / back to filetosser it download
#!/bin/sh
# /home/tosser/it
# The original dead-simple File Tosser v0.01e-6
#
# Ian Ward '01, this script has been placed in the public domain

ACCESS_LIST="/usr/bin/cut -f 2- /home/tosser/access.list"
# ^^ this command must produce a list of file paths
#
# --> STDIN
#  <file path>\n           file requested
#
# STDOUT -->
#  [ <raw file data> ]     file contents, if file is in access list
#  <EOF>


read filename
$ACCESS_LIST | while read acc 
do
        if [ "$filename" == "$acc" -a -f "$acc" ]; then
                /bin/cat "$acc"
                break
        fi
done