-$JAVA_HOME/bin/java $@ \
- -Djava.io.tmpdir=${basedir}/work/tmp \
- -Dosgi.install.area=${basedir} \
- -Dosgi.configuration.area=${basedir}/configuration \
- -Dosgi.frameworkClassPath=${FWCLASSPATH} \
- -Dosgi.framework=file:${basedir}/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar \
- -classpath ${CLASSPATH} \
- org.eclipse.equinox.launcher.Main \
- -console \
- -consoleLog
+if [ "${stopdaemon}" -eq 1 ]; then
+ if [ -e "${pidfile}" ]; then
+ daemonpid=`cat "${pidfile}"`
+ kill "${daemonpid}"
+ rm -f "${pidfile}"
+ echo "Controller with PID: ${daemonpid} -- Stopped!"
+ exit 0
+ else
+ echo "Doesn't seem any Controller daemon is currently running"
+ exit -1
+ fi
+fi
+
+if [ "${statusdaemon}" -eq 1 ]; then
+ if [ -e "${pidfile}" ]; then
+ daemonpid=`cat "${pidfile}"`
+ ps -p ${daemonpid} > /dev/null
+ daemonexists=$?
+ if [ "${daemonexists}" -eq 0 ]; then
+ echo "Controller with PID: ${daemonpid} -- Running!"
+ exit 0
+ else
+ echo "Controller with PID: ${daemonpid} -- Doesn't seem to exist"
+ rm -f "${pidfile}"
+ exit 0
+ fi
+ else
+ echo "Doesn't seem any Controller daemon is currently running, at least no PID file has been found"
+ exit -1
+ fi
+fi
+
+if [ "${startdaemon}" -eq 1 ]; then
+ if [ -e "${pidfile}" ]; then
+ echo "Another instance of controller running, check with $0 -status"
+ exit -1
+ fi
+ $JAVA_HOME/bin/java ${extraJVMOpts} \
+ -Djava.io.tmpdir=${basedir}/work/tmp \
+ -Dosgi.install.area=${basedir} \
+ -Dosgi.configuration.area=${basedir}/configuration \
+ -Dosgi.frameworkClassPath=${FWCLASSPATH} \
+ -Dosgi.framework=file:${basedir}/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar \
+ -classpath ${CLASSPATH} \
+ org.eclipse.equinox.launcher.Main \
+ -console ${daemonport} \
+ -consoleLog &
+ daemonpid=$!
+ echo ${daemonpid} > ${pidfile}
+elif [ "${consolestart}" -eq 1 ]; then
+ if [ -e "${pidfile}" ]; then
+ echo "Another instance of controller running, check with $0 -status"
+ exit -1
+ fi
+ $JAVA_HOME/bin/java ${extraJVMOpts} \
+ -Djava.io.tmpdir=${basedir}/work/tmp \
+ -Dosgi.install.area=${basedir} \
+ -Dosgi.configuration.area=${basedir}/configuration \
+ -Dosgi.frameworkClassPath=${FWCLASSPATH} \
+ -Dosgi.framework=file:${basedir}/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar \
+ -classpath ${CLASSPATH} \
+ org.eclipse.equinox.launcher.Main \
+ -console \
+ -consoleLog
+fi