#!/bin/sh

# This file is part of REMIND.
# Copyright (C) 1992-2026 by Dianne Skoll

# 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

# Set REM2PDF to the full pathname of the rem2pdf executable
REM2PDF=%REM2PDF%
export REM2PDF

#########################
#
# 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
    ;;

    calpdf)
    exec $DIR/calpdf
    ;;

    moon)
    exec $DIR/moon
    ;;

    hebps)
    exec $DIR/hebps
    ;;

    hebpdf)
    exec $DIR/hebpdf
    ;;

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

esac

exit 0
