#!/bin/sh ###################################################################### # Nombre: PutBacks # Descripcion: CGI para detectar e insertar citas a las paginas web # Author: Alejandro Rivero (rivero@sol.unizar.es) # Date: noviembre 1996 ########################################################################## # Usage: # With CERN httpd (3.0 or near) add to the config file some lines # indicating the directories to monitorize for backlinks # Exec /wwwlab/experiences/*.html /home/http/cgi-bin/PutBacks # Exec /alejo/*htm /home/http/cgi-bin/PutBacks # Path comes from start of data tree, as always. # Warnings: # - Provided as proof of concept only. A lot of work must we made to make # the script fool-proof. # - Use it at your OWN risk. ########################################################################## # variables for testing only. #SCRIPT_NAME="wwwlab/links.html" #HTTP_REFERER="http://some.site/nose.html" ######################################################################### # # We are sending out html files only. # echo 'Content-Type: text/html' echo '' # # base directory: root of our data tree # B_DIR=/home/http/htdocs # # Exclude file: list of nodes to exclude. Must have at least one name # EXCLUDE_FILE=/home/http/conf/hosts.noindex # # We first test for "default" http path specification, then look # for Welcome, welcome, or index files, in this order # if test -d ${B_DIR}/${SCRIPT_NAME}; then if test -f ${B_DIR}/${SCRIPT_NAME}/Welcome.html; then SCRIPT_NAME=${SCRIPT_NAME}/Welcome.html elif test -f ${B_DIR}/${SCRIPT_NAME}/welcome.html; then SCRIPT_NAME=${SCRIPT_NAME}/welcome.html elif test -f ${B_DIR}/${SCRIPT_NAME}/index.html; then SCRIPT_NAME=${SCRIPT_NAME}/index.html else echo "