#!/bin/sh
# Wrapper script for cct scripts that are needing CCT_HOME variable set

SCRIPTNAME=`basename $0`

export CCT_HOME=/usr/share/cct

if [ -x ${CCT_HOME}/scripts/${SCRIPTNAME}.sh ] ; then
    SCRIPT=${CCT_HOME}/scripts/${SCRIPTNAME}.sh
else
    if [ -x ${CCT_HOME}/scripts/${SCRIPTNAME}.pl ] ; then
        SCRIPT=${CCT_HOME}/scripts/${SCRIPTNAME}.pl
    else
        echo "Script ${CCT_HOME}/scripts/${SCRIPTNAME}.(sh|pl) is missing. Please check cct installation."
        exit 1
    fi
fi
${SCRIPT} $@
