#!/bin/ksh

#--- INIT ------------------------------
#needs $HOME
. $HOME/etc/ctrl.main.shi

[ -f $HOME/etc/setenv.sh ] && . $HOME/etc/setenv.sh

#--- FUNC ------------------------------
do_shell_()
{
	# On long term we may want to check if $DCMTK_VAR/custom.dic exists and set DCMDICTPATH to that file
	# until then unset DCMDICTPATH for optimization
	cat <<-EndOfInlineData
		DCMTK_HOME=$HOME/component/dcmtk
		DCMTK_VAR=$VAR/dcmtk
		DCMDICTPATH=
	EndOfInlineData

} #do_shell_()

do_start_()
{
	# create DCMTK_VAR
	[ ! -d "$DCMTK_VAR" ] && mkdir $DCMTK_VAR 2>/dev/null

	# All stuff moved to dicom component

	echo "To start pb-scp start dicom component (component/dicom/ctrl start)"
} #do_start_()

do_stop_()
{
	echo "To stop pb-scp stop dicom component (component/dicom/ctrl stop)"
} #do_stop_()


#
# List files/tables to be backed up grouped by categories
#
# output lines should be in '<category> <type> <names>' format
#
do_listbackup_()
{
	cat <<-EOFLISTBACKUP
		config.devices FILE ${DCMTK_VAR#$HOME/}/printer.cfg
	EOFLISTBACKUP
}


#--- MAIN ------------------------------

check_action_ $1
if [ 0 = $? ]; then
	do_$1_

else
	echo "--- Component dcmtk [ctrl $$]: Bad command: $1" >&2
	exit 1

fi
