diff --git a/s4-funcs.sh b/s4-funcs.sh index cfe01b7..42cf08a 100755 --- a/s4-funcs.sh +++ b/s4-funcs.sh @@ -2,25 +2,25 @@ # Here's global variable table. Do not use this names. # $HGid$ +test -n "$HTTP_HOST" && isCGI=true +if $isCGI; then + case "$0" in + *-world-*) + S4WORLD=${0#*world-} + S4WORLD=${S4WORLD%.*} + echo S4WORLD=$S4WORLD >&2 + worldconf=s4-config-${S4WORLD}.sh + ;; + esac -case "$0" in - *-world-*) - S4WORLD=${0#*world-} - S4WORLD=${S4WORLD%.*} - echo S4WORLD=$S4WORLD >&2 - worldconf=s4-config-${S4WORLD}.sh - ;; -esac - -echo worldconf=$worldconf >&2 -[ -f s4-config.sh ] && . ./s4-config.sh -[ -n "$worldconf" -a -e "$worldconf" ] && . ./$worldconf -echo DB=$DB >&2 - + echo worldconf=$worldconf >&2 + [ -f s4-config.sh ] && . ./s4-config.sh + [ -n "$worldconf" -a -e "$worldconf" ] && . ./$worldconf + echo DB=$DB >&2 +fi myname=`basename ${SCRIPT_NAME:-$0}` mydir=`dirname ${SCRIPT_FILENAME:-$0}` myargs="$@" -test -n "$HTTP_HOST" && isCGI=true PATH=/usr/local/sqlite3/bin:/usr/local/vim7/bin:/usr/iekei/ImageMagick/bin:/usr/local/ImageMagick/bin:$PATH tmpdir=${TMPDIR:-tmp} dbdir=${DBDIR:-db}