File:  [ELWIX - Embedded LightWeight unIX -] / elwix / config / etc / default / chilli / Attic / wwwsh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Jul 5 23:43:00 2011 UTC (13 years ago) by misho
Branches: misho
CVS tags: start, elwix1_9_mips, elwix1_9, elwix1_8, elwix1_7, elwix1_6, elwix1_5, elwix1_4, Patch1, ELWIX1_8, ELWIX1_7, ELWIX1_6, ELWIX1_5
ELWIX project

#!/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>