#!/bin/sh # (c) 2007 David Bird; Released under GPL. # This simple script dispatches the .chi embedded CGI scripts. # If .chi exists, and we have haserl, then we run "haserl file.chi" # Otherwise, we look for .chi.sh files to run as shell scripts. file=$(basename $1) dir=$(dirname $1) haserl=$(which haserl 2>/dev/null) cd $dir # should be make a bit safer! if [ -z "$haserl" ]; then if [ -e "$file.sh" ]; then sh $file.sh else echo "

You need to install haserl to serve pages with this wwwsh script!

" echo "

see http://haserl.sourceforge.net/

" fi exit fi $haserl $file