bin/sonews.sh
author cli
Mon, 24 Aug 2009 13:00:05 +0200
changeset 20 6ae5e4f8329b
parent 3 2fdc9cc89502
child 32 3af4237e4a15
permissions -rwxr-xr-x
Add stubs for org.sonews.acl and add method "impliedCapability" for org.sonews.command.Command interface.
     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