bin/sonews.sh
author chris <chris@marvin>
Fri, 26 Jun 2009 16:48:50 +0200
changeset 1 6fceb66e1ad7
child 3 2fdc9cc89502
permissions -rwxr-xr-x
Hooray... sonews/0.5.0 final

HG: Enter commit message. Lines beginning with 'HG:' are removed.
HG: Remove all lines to abort the collapse operation.
     1 #!/bin/bash
     2 SCRIPTROOT=$(pwd)
     3 CLASSPATH=$SCRIPTROOT/lib/sonews.jar:\
     4 $SCRIPTROOT/lib/mysql-connector-java.jar:\
     5 $SCRIPTROOT/lib/glassfish-mail.jar:\
     6 $SCRIPTROOT/lib/postgresql.jar
     7 
     8 LOGFILE=sonews.log
     9 PIDFILE=sonews.pid
    10 ARGS=$@
    11 
    12 MAINCLASS=org.sonews.daemon.Main
    13 JAVA=java
    14 
    15 case "$1" in
    16   start)
    17     echo "Starting sonews Newsserver..."
    18     $JAVA -classpath $CLASSPATH $MAINCLASS $ARGS &> $LOGFILE &
    19     echo $! > $PIDFILE
    20     ;;
    21   stop)
    22     echo "Stopping sonews Newsserver..."
    23     PID=`cat $PIDFILE`
    24     kill -15 $PID
    25     ;;
    26   setup)
    27     $JAVA -classpath $CLASSPATH org.sonews.util.DatabaseSetup
    28     ;;
    29   purge)
    30     $JAVA -classpath $CLASSPATH org.sonews.util.Purger
    31     ;;
    32 
    33   *)
    34     echo "Usage: sonews [start|stop|setup|purge]"
    35 esac