bin/sonews.sh
author cli
Thu, 20 Aug 2009 16:49:38 +0200
changeset 13 de98fd5b35f5
parent 3 2fdc9cc89502
child 32 3af4237e4a15
permissions -rwxr-xr-x
Remove aggregated group stubs and fix #543.
     1 #!/bin/bash
     2 SCRIPTROOT=$(pwd)
     3 CLASSPATH=$SCRIPTROOT/lib/sonews.jar:\
     4 $SCRIPTROOT/lib/sonews-helpers.jar:\
     5 $SCRIPTROOT/lib/mysql-connector-java.jar:\
     6 $SCRIPTROOT/lib/glassfish-mail.jar:\
     7 $SCRIPTROOT/lib/postgresql.jar
     8 
     9 LOGFILE=sonews.log
    10 PIDFILE=sonews.pid
    11 ARGS=$@
    12 
    13 MAINCLASS=org.sonews.daemon.Main
    14 JAVA=java
    15 
    16 case "$1" in
    17   start)
    18     echo "Starting sonews Newsserver..."
    19     $JAVA -classpath $CLASSPATH $MAINCLASS $ARGS &> $LOGFILE &
    20     echo $! > $PIDFILE
    21     ;;
    22   stop)
    23     echo "Stopping sonews Newsserver..."
    24     PID=`cat $PIDFILE`
    25     kill -15 $PID
    26     ;;
    27   setup)
    28     $JAVA -classpath $CLASSPATH org.sonews.util.DatabaseSetup
    29     ;;
    30   purge)
    31     $JAVA -classpath $CLASSPATH org.sonews.util.Purger
    32     ;;
    33 
    34   *)
    35     echo "Usage: sonews [start|stop|setup|purge]"
    36 esac