#!/bin/sh
#
#  Script:		SMcli-1
#  Instance:		4
#  %version:		10 %
#  Description:
#  %created_by:		blucas %
#  %date_created:	Mon Jul 20 12:49:06 2015 %

# SMcli startup script

# source /var/opt/SM/LAUNCHER_ENV
JAVA_EXEC=/usr/bin/java
FFEAT=FULL_SA
STORAGE_MANAGER_TYPE=6

if [ -f /etc/default/smclient.properties ]; then
    . /etc/default/smclient.properties
else
    SMCLI_JVM_OPTS=
fi

number=0
numargs=$#
while [ "$number" -lt "$numargs" ]
do
    if [ "`echo $1 | grep \'`" != "" ]
    then
        args=`echo $args`' '\"$1\"
    else
        args=`echo $args`' '\'$1\'
    fi
	number=`expr $number + 1`
    shift
done

echo "$JAVA_EXEC -Xmx128M -no-jre-restrict-search -Ddevmgr.datadir=$DATA_DIR -Ddevmgr.dmv.featureOption=$FFEAT -DstorageManager=$STORAGE_MANAGER_TYPE -classpath $CLIENT_DIR:$CLIENT_DIR/jhall.jar:$CLIENT_DIR/SMclient.jar $SMCLI_JVM_OPTS devmgr.cli.CommandLineInterface $args 2> /dev/null" >/tmp/SMcli.$$

sh /tmp/SMcli.$$
status=$?
rm /tmp/SMcli.$$

exit $status
