=== removed directory 'dhis-live' === removed file 'dhis-live/pom.xml' --- dhis-live/pom.xml 2014-11-26 15:44:28 +0000 +++ dhis-live/pom.xml 1970-01-01 00:00:00 +0000 @@ -1,188 +0,0 @@ - - - 4.0.0 - org.hisp.dhis - dhis-live - jar - 1.0-SNAPSHOT - DHIS Live - - http://maven.apache.org - - - 9.2.5.v20141112 - - - - - central - http://central.maven.org/maven2 - - - - - dhis2-live - install - - - - - maven-assembly-plugin - 2.2 - - - jar-with-dependencies - - - - org.hisp.dhis.TrayApp - - - - - - make-assembly - package - - single - - - - - - - - maven-compiler-plugin - 2.0.2 - - true - 1.7 - 1.7 - - - - - - org.bluestemsoftware.open.maven.plugin - launch4j-plugin - 1.5.0.0 - - - default - package - - launch4j - - - true - gui - ${project.build.directory}/dhis2-live.exe - dhis2-live.jar - dhis2 - normal - http://java.com/download - http://dhis2.org - false - false - - ${basedir}/util/launch4j/favicon.ico - - dhis-live.mutex - - - - 1.6.0_14 - - - ${basedir}/util/launch4j/dhis2-splash.bmp - false - 10 - false - - - - - embedded - package - - launch4j - - - true - gui - ${project.build.directory}/dhis2-live-embedded.exe - dhis2-live.jar - dhis2 - normal - http://java.com/download - http://dhis2.org - false - false - - ${basedir}/util/launch4j/favicon.ico - - dhis-live.mutex - - - - jre6 - 1.6.0_14 - - - ${basedir}/util/launch4j/dhis2-splash.bmp - false - 10 - false - - - - - - - - - - - org.eclipse.jetty - jetty-server - ${jettyVersion} - jar - - - org.eclipse.jetty - jetty-webapp - ${jettyVersion} - - - org.eclipse.jetty - jetty-util - ${jettyVersion} - jar - - - org.mortbay.jetty - servlet-api - 3.0.20100224 - jar - - - commons-logging - commons-logging - 1.1 - compile - - - avalon-framework - avalon-framework - - - logkit - logkit - - - - - - === removed file 'dhis-live/readme.txt' --- dhis-live/readme.txt 2010-04-23 13:11:55 +0000 +++ dhis-live/readme.txt 1970-01-01 00:00:00 +0000 @@ -1,61 +0,0 @@ - -Creates an executable jar which contains jetty server classes and a -simple tray icon controller. - -mvn package - -to build the jar and the exe file. - -On Ubuntu (and other gnome-ish environments). The java systemtray -is not supported on fancy 3d enhanced window managers. To work on -ubuntu, first run: - -metacity --replace - -to get back to a vanilla WM. - -The application looks for a dhis2.home system property that is being set by the Live jar. - -The expected structure looks like this: - -/ dhis2-live.jar -/ startup.bat (optional) -/ conf / -/ conf / hibernate.properties -/ database / -/ log / -/ webapps / -/ webapps / dhis -/ webapps / birt (optional) - -After that you are away. The application will install an icon in your -system tray or equivalent). The icons are currently crap but they can -be changed. If the server is stopped you get a blue one. While it is -starting it is orange. When its running it goes green. - -The h2 database is created in the db directory and log file in the log directory. - -To exit - right click the icon and select Exit. - -A sample hibernate.properties configured for H2 looks like this: - --------------------------------------------------------------------- -hibernate.dialect = org.hisp.dhis.dialect.H2Dialect -hibernate.connection.driver_class = org.h2.Driver -hibernate.connection.url = jdbc:h2:./database/dhis2;AUTO_SERVER=TRUE -hibernate.connection.username = sa -hibernate.connection.password = -hibernate.hbm2ddl.auto = update --------------------------------------------------------------------- - -The default port that the embedded jetty server listens on is 8080. If this -clashes with other services on your system it can be reconfigured by creating a -file conf/jetty.port which contains simply the desired server port, eg 8888. - - -TODO -1. make a nice "instrument panel" showing application status when you -click on the tray icon -postgres and h2, though the latter (and JavaDB) is targeted. -2. make richer configuration of jetty through web.xml or similar - === removed directory 'dhis-live/src' === removed directory 'dhis-live/src/main' === removed directory 'dhis-live/src/main/java' === removed directory 'dhis-live/src/main/java/org' === removed directory 'dhis-live/src/main/java/org/hisp' === removed directory 'dhis-live/src/main/java/org/hisp/dhis' === removed file 'dhis-live/src/main/java/org/hisp/dhis/TrayApp.java' --- dhis-live/src/main/java/org/hisp/dhis/TrayApp.java 2014-11-26 15:44:28 +0000 +++ dhis-live/src/main/java/org/hisp/dhis/TrayApp.java 1970-01-01 00:00:00 +0000 @@ -1,273 +0,0 @@ -/* - * Copyright (c) 2004-2009, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package org.hisp.dhis; - -import java.awt.AWTException; -import java.awt.Desktop; -import java.awt.Image; -import java.awt.MenuItem; -import java.awt.PopupMenu; -import java.awt.SystemTray; -import java.awt.TrayIcon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.net.URI; -import java.net.URL; - -import javax.swing.ImageIcon; -import javax.swing.JFrame; -import javax.swing.JOptionPane; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.eclipse.jetty.util.component.LifeCycle; - -/** - * @author Bob Jolliffe - */ -public class TrayApp - implements LifeCycle.Listener { - - private static final Log log = LogFactory.getLog(TrayApp.class); - - private static final String CONFIG_DIR = "/conf"; - private static final String STOPPED_ICON = "/icons/stopped.png"; - private static final String STARTING_ICON = "/icons/starting.png"; - private static final String FAILED_ICON = "/icons/failed.png"; - private static final String RUNNING_ICON = "/icons/running.png"; - private static final String CMD_OPEN = "Open DHIS 2 Live"; - private static final String CMD_EXIT = "Exit"; - - private final WebAppServer appServer; - - private TrayIcon trayIcon; - - private String installDir; - - // ------------------------------------------------------------------------- - // Main method - // ------------------------------------------------------------------------- - public static void main(String[] args) - throws Exception { - log.info("Environment variable DHIS2_HOME: " + System.getenv("DHIS2_HOME")); - if (!SystemTray.isSupported()) { - String message = "SystemTray not supported on this platform"; - JOptionPane.showMessageDialog((JFrame) null, message); - System.exit(0); - } - - TrayApp trayApp = new TrayApp(); - trayApp.start(); - } - - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - public TrayApp() - throws Exception { - log.info("Initialising DHIS 2 Live..."); - - installDir = getInstallDir(); - - if (installDir == null) { - log.info("jar not installed, setting installdir to DHIS2_HOME: " + System.getenv("DHIS2_HOME")); - installDir = System.getenv("DHIS2_HOME"); - } - - System.setProperty("dhis2.home", installDir + CONFIG_DIR); - System.setProperty("jetty.home", installDir); - - SystemTray tray = SystemTray.getSystemTray(); - - Image image = createImage(STOPPED_ICON, "tray icon"); - - PopupMenu popup = new PopupMenu(); - MenuItem openItem = new MenuItem(CMD_OPEN); - MenuItem exitItem = new MenuItem(CMD_EXIT); - popup.add(openItem); - popup.add(exitItem); - - trayIcon = new TrayIcon(image, "DHIS 2 Live", popup); - trayIcon.setImageAutoSize(true); - - ActionListener listener = new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - String cmd = e.getActionCommand(); - - switch (cmd) { - case CMD_OPEN: - launchBrowser(); - break; - case CMD_EXIT: - shutdown(); - break; - } - } - ; - }; - - openItem.addActionListener(listener); - exitItem.addActionListener(listener); - - try { - tray.add(trayIcon); - } catch (AWTException ex) { - log.warn("Oops: " + ex.toString()); - } - - appServer = new WebAppServer(installDir, this); - - } - - public void start() { - appServer.start(); - } - - // ------------------------------------------------------------------------- - // Listener implementation - // ------------------------------------------------------------------------- - @Override - public void lifeCycleFailure(LifeCycle arg0, Throwable arg1) { - log.warn("Lifecycle: server failed"); - trayIcon.setImage(createImage(FAILED_ICON, "Running icon")); - String message = "Web server failed to start - see logs for details"; - JOptionPane.showMessageDialog((JFrame) null, message); - shutdown(); - } - - @Override - public void lifeCycleStarted(LifeCycle arg0) { - log.info("Lifecycle: server started"); - trayIcon.displayMessage("Started", "DHIS 2 is running. Your browser will\n be pointed to " + getUrl() + ".", - TrayIcon.MessageType.INFO); - trayIcon.setToolTip("DHIS 2 Server running"); - trayIcon.setImage(createImage(RUNNING_ICON, "Running icon")); - - launchBrowser(); - } - - @Override - public void lifeCycleStarting(LifeCycle arg0) { - log.info("Lifecycle: server starting"); - trayIcon.displayMessage("Starting", "DHIS 2 is starting.\nPlease be patient.", TrayIcon.MessageType.INFO); - trayIcon.setImage(createImage(STARTING_ICON, "Starting icon")); - } - - @Override - public void lifeCycleStopped(LifeCycle arg0) { - log.info("Lifecycle: server stopped"); - trayIcon.displayMessage("Stopped", "DHIS 2 has stopped.", TrayIcon.MessageType.INFO); - trayIcon.setImage(createImage(STOPPED_ICON, "Running icon")); - } - - @Override - public void lifeCycleStopping(LifeCycle arg0) { - log.info("Lifecycle: server stopping"); - } - - // ------------------------------------------------------------------------- - // Supportive methods - // ------------------------------------------------------------------------- - /** - * Returns the URL where the application can be accessed. - * - * @return the URL where the application can be accessed. - */ - private String getUrl() { - return appServer.getURI().toString(); - } - - /** - * Launches the application in the default browser. - */ - private void launchBrowser() { - try { - Desktop.getDesktop().browse(URI.create(getUrl())); - } catch (Exception ex) { - log.warn("Couldn't open default desktop browser: " + ex); - } - } - - /** - * Shuts down the web application server. - */ - private void shutdown() { - log.info("Graceful shutdown..."); - try { - appServer.shutdown(); - } catch (Exception ex) { - log.warn("Oops: " + ex.toString()); - } - log.info("Exiting..."); - System.exit(0); - } - - /** - * Creates an image based on the given path and description. - * - * @param path the image path. - * @param description the image description. - * @return an Image. - */ - private static Image createImage(String path, String description) { - URL imageURL = TrayApp.class.getResource(path); - - if (imageURL == null) { - log.warn("Resource not found: " + path); - return null; - } else { - return (new ImageIcon(imageURL, description)).getImage(); - } - } - - /** - * The getInstallDir method is a hack to determine the current - * directory the DHIS 2 Live package is installed in. It does this by - * finding the file URL of a resource within the executable jar and - * extracting the installation path from that. - * - * @return a String value representing the installation - * directory - */ - private static String getInstallDir() { - // find a resource - String resourceString = TrayApp.class.getResource("/icons/").toString(); - // we expect to see something of the form: - // "jar:file:/dhis_xxx.jar!/icons" - if (!resourceString.startsWith("jar:file:")) { - // we're in trouble - its not in a jar file - return null; - } - // find the last "/" just before the "!" - int endIndex = resourceString.lastIndexOf("/", resourceString.lastIndexOf("!")); - String result = resourceString.substring(9, endIndex); - // replace encoded spaces - result = result.replaceAll("%20", " "); - return result; - } -} === removed file 'dhis-live/src/main/java/org/hisp/dhis/WebAppServer.java' --- dhis-live/src/main/java/org/hisp/dhis/WebAppServer.java 2015-03-10 12:22:35 +0000 +++ dhis-live/src/main/java/org/hisp/dhis/WebAppServer.java 1970-01-01 00:00:00 +0000 @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2004-2009, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/** - * - * @author Bob Jolliffe - * @version $$Id$$ - */ -package org.hisp.dhis; - -import java.io.File; -import java.net.URI; -import java.util.Scanner; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.webapp.WebAppContext; - -/** - * @author Bob Jolliffe - */ -public class WebAppServer extends Thread { - - public static final String DHIS_DIR = "/webapps/dhis"; - - public static final String JETTY_PORT_CONF = "/conf/jetty.port"; - - public static final int DEFAULT_JETTY_PORT = 8080; - - public static int MAX_FORM_CONTENT_SIZE = 5000000; - - private static final Log log = LogFactory.getLog(WebAppServer.class); - - protected Server server; - - public WebAppServer(String installDir, LifeCycle.Listener serverListener) - throws Exception { - - int port; - try (Scanner scanner = new Scanner(new File(installDir + JETTY_PORT_CONF))) { - port = scanner.nextInt(); - log.info("Loading DHIS 2 on port: " + port); - } catch (Exception ex) { - log.info("Couldn't load port number from " + installDir + JETTY_PORT_CONF); - port = DEFAULT_JETTY_PORT; - log.info("Loading DHIS 2 on port: " + DEFAULT_JETTY_PORT); - } - - server = new Server(port); - server.addLifeCycleListener(serverListener); - loadDHISContext(installDir + DHIS_DIR); - } - - private void loadDHISContext(String webappPath) { - WebAppContext dhisWebApp = new WebAppContext(); - dhisWebApp.setMaxFormContentSize(MAX_FORM_CONTENT_SIZE); - dhisWebApp.setWar(webappPath); - log.info("Setting DHIS 2 web app context to: " + webappPath); - - server.setHandler(dhisWebApp); - } - - @Override - public void run() { - try { - log.debug("Server thread starting"); - server.start(); - log.debug("Server thread exiting"); - } catch (Exception ex) { - log.error("Server wouldn't start : " + ex); - } - } - - public void shutdown() - throws Exception { - server.stop(); - } - - public URI getURI() { - return server.getURI(); - } -} === removed directory 'dhis-live/src/main/resources' === removed directory 'dhis-live/src/main/resources/icons' === removed file 'dhis-live/src/main/resources/icons/failed.png' Binary files dhis-live/src/main/resources/icons/failed.png 2009-04-22 21:34:35 +0000 and dhis-live/src/main/resources/icons/failed.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-live/src/main/resources/icons/running.png' Binary files dhis-live/src/main/resources/icons/running.png 2010-11-29 15:11:43 +0000 and dhis-live/src/main/resources/icons/running.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-live/src/main/resources/icons/starting.png' Binary files dhis-live/src/main/resources/icons/starting.png 2010-11-29 15:11:43 +0000 and dhis-live/src/main/resources/icons/starting.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-live/src/main/resources/icons/stopped.png' Binary files dhis-live/src/main/resources/icons/stopped.png 2009-04-22 21:34:35 +0000 and dhis-live/src/main/resources/icons/stopped.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-live/src/main/resources/log4j.properties' --- dhis-live/src/main/resources/log4j.properties 2010-09-14 22:43:21 +0000 +++ dhis-live/src/main/resources/log4j.properties 1970-01-01 00:00:00 +0000 @@ -1,28 +0,0 @@ -# Configuration file for log4j - -# Log to file setup -log4j.appender.file = org.apache.log4j.RollingFileAppender -log4j.appender.file.File = log/dhis.log -log4j.appender.file.MaxFileSize = 100KB -log4j.appender.file.MaxBackupIndex = 3 -log4j.appender.file.layout = org.apache.log4j.PatternLayout -log4j.appender.file.layout.ConversionPattern = * %-5p %d{ABSOLUTE} %m (%F [%t])%n - -# Log to console setup -log4j.appender.console = org.apache.log4j.ConsoleAppender -log4j.appender.console.layout = org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern = * %-5p %d{ABSOLUTE} %m (%F [%t])%n - -#Audit log level -log4j.appender.AUDIT=org.apache.log4j.DailyRollingFileAppender -log4j.appender.AUDIT.File= log/audit.log -log4j.appender.AUDIT.DatePattern='.'yyyy-MM-dd -log4j.appender.AUDIT.MaxFileSize = 100KB -log4j.appender.AUDIT.MaxBackupIndex = 3 -log4j.appender.AUDIT.threshold=AUDIT_TRAIL#org.hisp.dhis.system.util.AuditLogLevel -log4j.appender.AUDIT.layout=org.apache.log4j.PatternLayout -log4j.appender.AUDIT.layout.ConversionPattern= * %-5p %d{ABSOLUTE} %m %n - -# Categories (order: DEBUG, INFO, WARN, ERROR, FATAL) -log4j.rootCategory = WARN, console -log4j.category.org.hisp.dhis = INFO, file \ No newline at end of file === removed directory 'dhis-live/src/test' === removed directory 'dhis-live/src/test/java' === removed directory 'dhis-live/util' === removed directory 'dhis-live/util/config' === removed file 'dhis-live/util/config/dhislive-config.xml' --- dhis-live/util/config/dhislive-config.xml 2010-06-10 09:07:05 +0000 +++ dhis-live/util/config/dhislive-config.xml 1970-01-01 00:00:00 +0000 @@ -1,29 +0,0 @@ - - - - - org.hibernate.dialect.PostgreSQLDialect - jdbc:postgresql://127.0.0.1:5432/dhis2_zm_prod2 - postgres - postgres - - - org.hibernate.dialect.PostgreSQLDialect - jdbc:postgresql://127.0.0.1:5432/dhis2_zm_test - postgres - postgres - - - - - - - Firefox - /usr/share/bin/firefox - - - - \ No newline at end of file === removed file 'dhis-live/util/config/launch4j-dhis2-conf.xml' --- dhis-live/util/config/launch4j-dhis2-conf.xml 2010-11-29 15:15:32 +0000 +++ dhis-live/util/config/launch4j-dhis2-conf.xml 1970-01-01 00:00:00 +0000 @@ -1,32 +0,0 @@ - - true - gui - dhis2-live.jar - dhis2-live.exe - - - - normal - http://java.com/download - - false - false - - /home/larshelg/dev/src/2.0.5/dhis-live/util/launch4j/favicon.ico - - dhis2.live.mutex - - - - - 1.6.0_10 - - preferJre - - - /home/larshelg/dev/src/2.0.5/dhis-live/util/launch4j/dhis2-splash.bmp - true - 10 - false - - \ No newline at end of file === removed directory 'dhis-live/util/div' === removed file 'dhis-live/util/div/hibernate.properties' --- dhis-live/util/div/hibernate.properties 2010-11-10 13:12:59 +0000 +++ dhis-live/util/div/hibernate.properties 1970-01-01 00:00:00 +0000 @@ -1,6 +0,0 @@ -hibernate.dialect = org.hibernate.dialect.H2Dialect -hibernate.connection.driver_class = org.h2.Driver -hibernate.connection.url = jdbc:h2:./database/dhis2;AUTO_SERVER=TRUE -hibernate.connection.username = sa -hibernate.connection.password = -hibernate.hbm2ddl.auto = update === removed directory 'dhis-live/util/launch4j' === removed file 'dhis-live/util/launch4j/dhis2-icon.png' Binary files dhis-live/util/launch4j/dhis2-icon.png 2010-10-21 16:27:28 +0000 and dhis-live/util/launch4j/dhis2-icon.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-live/util/launch4j/dhis2-splash.bmp' Binary files dhis-live/util/launch4j/dhis2-splash.bmp 2009-09-11 19:03:58 +0000 and dhis-live/util/launch4j/dhis2-splash.bmp 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-live/util/launch4j/favicon.ico' Binary files dhis-live/util/launch4j/favicon.ico 2009-09-11 19:03:58 +0000 and dhis-live/util/launch4j/favicon.ico 1970-01-01 00:00:00 +0000 differ === removed directory 'dhis-live/util/script' === removed file 'dhis-live/util/script/startup.sh' --- dhis-live/util/script/startup.sh 2015-01-12 12:52:58 +0000 +++ dhis-live/util/script/startup.sh 1970-01-01 00:00:00 +0000 @@ -1,29 +0,0 @@ -#!/bin/sh - -# get ready to catch errors -trap ctrl_c INT - -ctrl_c () { - echo - echo "============================================" - echo "Keyboard interrupt" - echo "DHIS2 live exited" - echo "============================================" - exit -} - -unexpected_exit () { - echo "============================================" - echo "DHIS2 live exited with an error" - echo "Make sure you have a java runtime in your path" - echo "============================================" - read -p "Press enter to exit" ch - exit -} - -echo "Starting DHIS2 live ..." - -DHIS2LIVE=`dirname $0` -java -jar $DHIS2LIVE/dhis2-live.jar || unexpected_exit -echo "DHIS2 live exited normally" -