#!/bin/sh

# This file is part of REMIND.
# Copyright (C) 1992-1997 by Dianne Skoll
# Copyright (C) 1999-2000 by Roaring Penguin Software Inc.

# CAL_DISPATCH -- Shell script for CGI directory to dispatch calendar
# commands.

#########################
#
# Parameters for you to change
#
#########################

# Set DIR to the directory in which all the scripts live.  They must all
# be in the same directory.  The scripts are:
# cal_dispatch, cal_ps, hebdate, hebps, moon, sunrise and sunset.
# In addition, the reminder files hebbg.ps, hebdate.rem, moon.rem,
# sunrise.rem and sunset.rem must live in $DIR.
DIR=%SCRIPTDIR%
export DIR

# Set REMIND to the full pathname of the Remind executable.
REMIND=%REMIND%
export REMIND

# Set REM2PS to the full pathname of the rem2ps executable
REM2PS=%REM2PS%
export REM2PS

#########################
#
# Don't change anything after this.
#
#########################

if [ "$1" = "" ] ; then
    exit 0
fi


case "$1" in
    sunrise)
    exec $DIR/sunrise
    ;;

    sunset)
    exec $DIR/sunset
    ;;

    hebdate)
    exec $DIR/hebdate
    ;;

    calps)
    exec $DIR/calps
    ;;

    moon)
    exec $DIR/moon
    ;;

    hebps)
    exec $DIR/hebps
    ;;

    hebhtml)
    if [ "$2" = "" -o "$3" = "" ] ; then
	exec $DIR/hebhtml
    else
	exec $DIR/hebhtml "$2" "$3"
    fi
    ;;

esac

exit 0
