#! /bin/sh

### BEGIN INIT INFO
# Provides:          DIVAS4LINUX
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Default-Start:     2 3 5
# Default-Stop:      0 1 6
# Short-Description: Diva Server for Linux
# Description:       Starts Eicon Networks drivers
#       for Diva Server line of adapters
#       see http://www.eicon.com
### END INIT INFO

if [ -f /usr/lib/eicon/divas/divadidd.ko ]
then
diva_dir=/usr/lib/eicon/divas
else

if [ -f /usr/lib/eicon/divas/divadidd.o ]
then
diva_dir=/usr/lib/eicon/divas
else
diva_dir=/usr/lib/isdn/eicon
fi

fi

case "$1" in
    stop)
        $diva_dir/Stop
        exit 0
        ;;
    *)
        ;;
esac

$diva_dir/divas_cfg.rc
if [ $(($?)) -ne 0 ]
then
exit 1
fi

# ----------------------------------
#  Please add commands to be executed
#  after the start of Diva drivers
#  below.
#  Please use "diva_dir" as path
#  to "divactrl" utility.
#
#  "${diva_dir}/divactrl mantool -Exclusive -WDog -c 1000" - access CAPI management interface
#  "${diva_dir}/divactrl mantool -Exclusive -WDog -c 1001" - access TTY management interface
#
# ----------------------------------

exit 0

