File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / coova-chilli / www / wwwsh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 22:48:25 2012 UTC (12 years, 4 months ago) by misho
Branches: coova-chilli, MAIN
CVS tags: v1_0_12, HEAD
coova-chilli

#!/bin/sh
# (c) 2007 David Bird; Released under GPL.
# This simple script dispatches the <file>.chi embedded CGI scripts.
# If <file>.chi exists, and we have haserl, then we run "haserl file.chi"
# Otherwise, we look for <file>.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 "<p>You need to install haserl to serve pages with this wwwsh script!</p>"
	echo "<p>see <a href='http://haserl.sourceforge.net/'>http://haserl.sourceforge.net/</a></p>"
    fi
    exit
fi

$haserl $file

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>