bin/sonews.sh
author cli
Mon Jun 06 20:12:21 2011 +0200 (2011-06-06)
changeset 42 7f84f4de2893
parent 3 2fdc9cc89502
child 76 b5690fc25af6
permissions -rwxr-xr-x
Add HSQLDB stubs and reformat some source files.
     1 #!/bin/bash
     2 cd `dirname $0`/..
     3 NEWSROOT=`pwd`
     4 CLASSPATH=$NEWSROOT/lib/sonews.jar:\
     5 $NEWSROOT/lib/sonews-helpers.jar:\
     6 $NEWSROOT/lib/mysql-connector-java.jar:\
     7 $NEWSROOT/lib/glassfish-mail.jar:\
     8 $NEWSROOT/lib/postgresql.jar
     9 
    10 LOGFILE=/var/log/sonews.log
    11 PIDFILE=/var/pid/sonews.pid
    12 ARGS=$@
    13 
    14 MAINCLASS=org.sonews.Main
    15 JAVA=$JAVA_HOME/bin/java
    16 
    17 case "$1" in
    18   start)
    19     echo "Starting sonews Newsserver..."
    20     $JAVA -classpath $CLASSPATH $MAINCLASS $ARGS &> $LOGFILE &
    21     echo $! > $PIDFILE
    22     ;;
    23   stop)
    24     echo "Stopping sonews Newsserver..."
    25     PID=`cat $PIDFILE`
    26     kill -15 $PID
    27     ;;
    28   setup)
    29     $JAVA -classpath $CLASSPATH org.sonews.util.DatabaseSetup
    30     ;;
    31   purge)
    32     $JAVA -classpath $CLASSPATH org.sonews.util.Purger
    33     ;;
    34 
    35   *)
    36     echo "Usage: sonews [start|stop|setup|purge]"
    37 esac