#!/bin/sh

ACTIANZEN_ROOT=/usr/local/actianzen
PVSW_BIN=$ACTIANZEN_ROOT/bin
PLUGINS=$PVSW_BIN/plugins

if [ $(uname -s) = "Darwin" ]
then
    export DYLD_LIBRARY_PATH=$ACTIANZEN_ROOT/lib64:$DYLD_LIBRARY_PATH
    SWT_PLUGIN=org.eclipse.swt.cocoa.macosx.x86_64_3.8.1.v3836b.jar
    VM_ARGS=-XstartOnFirstThread
    JAVA_BIN=$ACTIANZEN_ROOT/jre/bin/java
else
    export LD_LIBRARY_PATH=$ACTIANZEN_ROOT/lib64:$LD_LIBRARY_PATH
    SWT_PLUGIN=org.eclipse.swt.gtk.linux.x86_64_3.8.1.v3836b.jar
    VM_ARGS=
    JAVA_BIN=$ACTIANZEN_ROOT/jre/bin/java
fi

JARS="$PVSW_BIN/guipaadm.jar:$PLUGINS/$SWT_PLUGIN:$PLUGINS/org.eclipse.core.commands_3.6.1.v20120912-135020.jar:$PLUGINS/org.eclipse.equinox.common_3.6.100.v20120522-1841.jar:$PLUGINS/org.eclipse.jface_3.8.0.v20120912-135020.jar:$PLUGINS/org.eclipse.osgi_3.8.2.v20130124-134944.jar:$PLUGINS/org.eclipse.ui.forms_3.5.200.v20120521-2332.jar:$PLUGINS/com.ibm.icu_4.4.2.v20110823.jar:$PLUGINS/org.eclipse.jface.nlja_3.3.1.M20070910-0800b.jar:$PLUGINS/org.eclipse.ui.forms.nlja_3.3.0.v20070511.jar"

$JAVA_BIN $VM_ARGS -cp $JARS com.pervasive.utilities.guipaadm.PhoneActivationApp
