bin/sonews.sh
author cli
Sun, 29 Aug 2010 17:03:21 +0200
changeset 33 f9bf183447d1
parent 3 2fdc9cc89502
child 32 3af4237e4a15
permissions -rwxr-xr-x
Article(javax.mail.Message) now has a safe method to read the byte body from the given message object (fixes #16).
     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